• Julien Muchembled's avatar
    ZSQLCatalog: fix buildQuery with explicit search key and dict value · f269e6ca
    Julien Muchembled authored
    This fixes things like:
      portal_catalog(source_reference={'query':'foo OR bar', 'key':'KeywordKey'})
    or:
      portal_catalog(query=AutoQuery(source_reference='foo OR bar', key='KeywordKey'))
    
    So we get:
      (`...`.`reference` LIKE '%foo%' OR `...`.`reference` LIKE '%bar%')
    
    instead of:
      `...`.`reference` IN ('{\'query\': \'foo\', \'key\': \'KeywordKey\'}',
                            '{\'query\': \'bar\', \'key\': \'KeywordKey\'}')
    
    Also, remove default values as it makes it easy for caller to leave arguments
    out by mistake.
    Also, use positional arguments as they are faster than named arguments.
    
    See merge request nexedi/erp5!1698
    f269e6ca
SQLCatalog.py 93.6 KB