Commit 632146cd authored by Jean-Paul Smets's avatar Jean-Paul Smets

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
parent 706550b4
...@@ -352,22 +352,12 @@ class Catalog(Persistent, Acquisition.Implicit, ExtensionClass.Base): ...@@ -352,22 +352,12 @@ class Catalog(Persistent, Acquisition.Implicit, ExtensionClass.Base):
kw['path'] = path kw['path'] = path
kw['uid'] = index kw['uid'] = index
kw['insert_catalog_line'] = insert_catalog_line kw['insert_catalog_line'] = insert_catalog_line
# LOG # Alter/Create row
# Alter row
# Create row
try:
zope_root = self.getPortalObject().aq_parent zope_root = self.getPortalObject().aq_parent
root_indexable = int(getattr(zope_root,'isIndexable',1)) root_indexable = int(getattr(zope_root,'isIndexable',1))
if root_indexable: if root_indexable:
#LOG("Call SQL Method %s with args:" % method_name,0, str(kw)) #LOG("Call SQL Method %s with args:" % method_name,0, str(kw))
method(**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))
def uncatalogObject(self, path): def uncatalogObject(self, path):
""" """
...@@ -487,6 +477,10 @@ class Catalog(Persistent, Acquisition.Implicit, ExtensionClass.Base): ...@@ -487,6 +477,10 @@ class Catalog(Persistent, Acquisition.Implicit, ExtensionClass.Base):
""" Accesses a single record for a given path """ """ Accesses a single record for a given path """
return self.getMetadataForPath(path) return self.getMetadataForPath(path)
def buildSQLQuery(self, REQUEST=None, **kw):
"""
"""
def queryResults(self, sql_method, REQUEST=None, used=None, **kw): def queryResults(self, sql_method, REQUEST=None, used=None, **kw):
""" Builds a complex SQL query to simulate ZCalatog behaviour """ """ Builds a complex SQL query to simulate ZCalatog behaviour """
""" Returns a list of brains from a set of constraints on variables """ """ Returns a list of brains from a set of constraints on variables """
...@@ -631,6 +625,7 @@ class Catalog(Persistent, Acquisition.Implicit, ExtensionClass.Base): ...@@ -631,6 +625,7 @@ class Catalog(Persistent, Acquisition.Implicit, ExtensionClass.Base):
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 """ """ Builds a complex SQL query to simulate ZCalatog behaviour """
""" Returns a list of brains from a set of constraints on variables """ """ Returns a list of brains from a set of constraints on variables """
# The used argument is deprecated and is ignored
try: try:
# Get the search method # Get the search method
method = getattr(self, self.sql_search_results) method = getattr(self, self.sql_search_results)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment