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

Łukasz Nowak lukasz.nowak at ventis.com.pl
Tue Oct 23 09:49:34 CEST 2007


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

-- 
Łukasz Nowak R&D Ventis http://www.ventis.com.pl/
tel: +48 32 768 16 85 fax: +48 32 392 10 61
``Use the Source, Luke...'' I am only craftsman.



More information about the Erp5-dev mailing list