[Erp5-report] r6575 - in /erp5/trunk/products/ZSQLCatalog: SQLCatalog.py ZSQLCatalog.py

nobody at svn.erp5.org nobody at svn.erp5.org
Thu Apr 13 13:28:28 CEST 2006


Author: seb
Date: Thu Apr 13 13:28:23 2006
New Revision: 6575

URL: http://svn.erp5.org?rev=6575&view=rev
Log:
added support for dynamic keys

Modified:
    erp5/trunk/products/ZSQLCatalog/SQLCatalog.py
    erp5/trunk/products/ZSQLCatalog/ZSQLCatalog.py

Modified: erp5/trunk/products/ZSQLCatalog/SQLCatalog.py
URL: http://svn.erp5.org/erp5/trunk/products/ZSQLCatalog/SQLCatalog.py?rev=6575&r1=6574&r2=6575&view=diff
==============================================================================
--- erp5/trunk/products/ZSQLCatalog/SQLCatalog.py (original)
+++ erp5/trunk/products/ZSQLCatalog/SQLCatalog.py Thu Apr 13 13:28:23 2006
@@ -1337,6 +1337,16 @@
       value = sql_quote(str(value))
     return value
 
+  def getSqlCatalogRelatedKeyList(self, **kw):
+    """
+    Return the list of related keys.
+    This method can be overidden in order to implement 
+    dynamic generation of some related keys.
+    """
+    dynamic_list = self.getDynamicRelatedKeyList(**kw)
+    full_list = list(dynamic_list) + list(self.sql_catalog_related_keys)
+    return full_list
+
   def buildSQLQuery(self, query_table='catalog', REQUEST=None,
                           ignore_empty_string=1,**kw):
     """ Builds a complex SQL query to simulate ZCalatog behaviour """
@@ -1361,7 +1371,7 @@
 
     # Define related maps
     # each tuple has the form (key, 'table1,table2,table3/column/where_expression')
-    related_tuples = self.sql_catalog_related_keys
+    related_tuples = self.getSqlCatalogRelatedKeyList(**kw)
     #LOG('related_tuples', 0, str(related_tuples))
     related_keys = []
     related_method = {}

Modified: erp5/trunk/products/ZSQLCatalog/ZSQLCatalog.py
URL: http://svn.erp5.org/erp5/trunk/products/ZSQLCatalog/ZSQLCatalog.py?rev=6575&r1=6574&r2=6575&view=diff
==============================================================================
--- erp5/trunk/products/ZSQLCatalog/ZSQLCatalog.py (original)
+++ erp5/trunk/products/ZSQLCatalog/ZSQLCatalog.py Thu Apr 13 13:28:23 2006
@@ -580,6 +580,12 @@
     if catalog is not None:
       return catalog.newUid()
 
+  def getDynamicRelatedKeyList(self, sql_catalog_id=None,**kw):
+    """
+    Return the list of dynamic related keys.
+    """
+    return []
+
   def wrapObject(self, object, **kw):
     """
       Return a wrapped object for reindexing.




More information about the Erp5-report mailing list