From 632146cd65779adf5cc8eaa30808a58e974352ee Mon Sep 17 00:00:00 2001 From: Jean-Paul Smets <jp@nexedi.com> Date: Wed, 28 Jul 2004 06:22:43 +0000 Subject: [PATCH] fixed bug introduced (try/except) in 2.11 and added empty method for building SQL query git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@1299 20353a03-c40f-0410-a6d1-a30d3c3de9de --- product/ZSQLCatalog/SQLCatalog.py | 29 ++++++++++++----------------- 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/product/ZSQLCatalog/SQLCatalog.py b/product/ZSQLCatalog/SQLCatalog.py index de6a7346c5..fb77fa79cb 100755 --- a/product/ZSQLCatalog/SQLCatalog.py +++ b/product/ZSQLCatalog/SQLCatalog.py @@ -352,22 +352,12 @@ class Catalog(Persistent, Acquisition.Implicit, ExtensionClass.Base): kw['path'] = path kw['uid'] = index kw['insert_catalog_line'] = insert_catalog_line - # LOG - # Alter row - # Create row - try: - zope_root = self.getPortalObject().aq_parent - root_indexable = int(getattr(zope_root,'isIndexable',1)) - if root_indexable: - #LOG("Call SQL Method %s with args:" % method_name,0, str(kw)) - method(**kw) - except: - LOG("SQLCatalog Warning: could not catalog object with method %s" % method_name,100, str(path)) - #except: - # # # This is a real LOG message - # # # which is required in order to be able to import .zexp files - # LOG("SQLCatalog Warning: could not catalog object with method %s" % method_name, - # 100,str(path)) + # Alter/Create row + zope_root = self.getPortalObject().aq_parent + root_indexable = int(getattr(zope_root,'isIndexable',1)) + if root_indexable: + #LOG("Call SQL Method %s with args:" % method_name,0, str(kw)) + method(**kw) def uncatalogObject(self, path): """ @@ -487,6 +477,10 @@ class Catalog(Persistent, Acquisition.Implicit, ExtensionClass.Base): """ Accesses a single record for a given path """ return self.getMetadataForPath(path) + def buildSQLQuery(self, REQUEST=None, **kw): + """ + """ + def queryResults(self, sql_method, REQUEST=None, used=None, **kw): """ Builds a complex SQL query to simulate ZCalatog behaviour """ """ Returns a list of brains from a set of constraints on variables """ @@ -628,9 +622,10 @@ class Catalog(Persistent, Acquisition.Implicit, ExtensionClass.Base): # LOG('queryResults',0,'kw: %s' % str(kw)) return sql_method(**kw) - def searchResults(self, REQUEST=None, used=None, **kw): + def searchResults(self, REQUEST=None, used=None, **kw): """ Builds a complex SQL query to simulate ZCalatog behaviour """ """ Returns a list of brains from a set of constraints on variables """ + # The used argument is deprecated and is ignored try: # Get the search method method = getattr(self, self.sql_search_results) -- 2.30.9