[Erp5-dev] How to search for None in catalog?

Jean-Paul Smets jp at nexedi.com
Tue Oct 23 09:54:53 CEST 2007


The solution is in Query.
Jerome will tell you how to do once he has reviewed the Query API (which
he is doing right now).
JPS.


Łukasz Nowak a écrit :
> Hello,
>
> I've got:
>
> search_kw = {
>   'portal_type' : 'Sale Supply',
>   'destination_section_title' : context.getDestinationTitle()
> }
>
> Using above in portal_catalog I'm able to find all objects of given
> portal_type, which has filled destination_section_title
>
> But I'd like to extend it to find objects which has
> destination_section_title set to None or '' - SQL expression:
>   destination_section_title = 'context.getDestinationTitle()' OR
>   destination_section_title = None OR
>   destination_section_title = ''
>
> But creating:
> search_kw = {
>   'portal_type' : 'Sale Supply',
>   'destination_section_title' : \
> [context.getDestinationTitle(),None,'None',''] }
>
> Is giving me:
>   related_catalog_1.title = 'context.getDestinationTitle()' OR
>   related_catalog_1.title = 'None' OR related_catalog_1.title = 'None'
>
> So how my I search for None,'' objects properties in catalog?
>
> Regards,
> Luke
>
>   


-- 
Jean-Paul Smets-Solanes, Nexedi CEO - Tel. +33(0)6 62 05 76 14
Nexedi: Consulting and Development of Libre / Open Source Software
http://www.nexedi.com
ERP5: Libre/ Open Source ERP Software for small and medium companies
http://www.erp5.org






More information about the Erp5-dev mailing list