[Erp5-report] r9897 - /erp5/trunk/products/ERP5/Tool/IdTool.py

nobody at svn.erp5.org nobody at svn.erp5.org
Thu Sep 14 09:50:41 CEST 2006


Author: vincent
Date: Thu Sep 14 09:50:38 2006
New Revision: 9897

URL: http://svn.erp5.org?rev=9897&view=rev
Log:
Use the final name for zsql methods.
Cleanup docstring.

Modified:
    erp5/trunk/products/ERP5/Tool/IdTool.py

Modified: erp5/trunk/products/ERP5/Tool/IdTool.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Tool/IdTool.py?rev=9897&r1=9896&r2=9897&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Tool/IdTool.py (original)
+++ erp5/trunk/products/ERP5/Tool/IdTool.py Thu Sep 14 09:50:38 2006
@@ -172,12 +172,9 @@
       persistant mapping to be persistent.
       We use MySQL to generate an ID, because it is atomic and we don't want
       to generate any conflict at zope level. The possible downfall is that
-      some IDs might be skipped because of failed transactions (MySQL is not
-      and must not be rolled back).
-      2 ZSQL methods are required for this method to work :
-       - 
-      "Length" because the id is stored in a BTrees.Length. It doesn't have
-      to be a length.
+      some IDs might be skipped because of failed transactions.
+      "Length" is because the id is stored in a python object inspired by
+      BTrees.Length. It doesn't have to be a length.
     """
     if getattr(self, 'dict_length_ids', None) is None:
       self.dict_length_ids = PersistentMapping()
@@ -187,8 +184,9 @@
       if not isinstance(id_group, str):
         id_group = repr(id_group)
       default = isinstance(default, int) and default or 1
-      query = getattr(self, 'Base_zGenerateId')
-      commit = getattr(self, 'Base_zCommit')
+      portal_catalog = self.getPortalObject().portal_catalog['erp5_mysql']
+      query = getattr(portal_catalog, 'z_portal_ids_generate_id')
+      commit = getattr(portal_catalog, 'z_portal_ids_commit')
       if None not in (query, commit):
         result = query(id_group=id_group, default=default)
         commit()




More information about the Erp5-report mailing list