[Erp5-report] r33371 seb - in /erp5/trunk/products/ERP5/interfaces: id_generator.py id_tool.py

nobody at svn.erp5.org nobody at svn.erp5.org
Thu Mar 4 09:43:51 CET 2010


Author: seb
Date: Thu Mar  4 09:43:50 2010
New Revision: 33371

URL: http://svn.erp5.org?rev=33371&view=rev
Log:
add API to initialize and clear generators

Modified:
    erp5/trunk/products/ERP5/interfaces/id_generator.py
    erp5/trunk/products/ERP5/interfaces/id_tool.py

Modified: erp5/trunk/products/ERP5/interfaces/id_generator.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/interfaces/id_generator.py?rev=33371&r1=33370&r2=33371&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/interfaces/id_generator.py [utf8] (original)
+++ erp5/trunk/products/ERP5/interfaces/id_generator.py [utf8] Thu Mar  4 09:43:50 2010
@@ -76,3 +76,21 @@
        id (optional). By default, ids are managed like integers and
        are increased one by one
     """
+
+  def initializeGenerator():
+    """
+    Initialize generator. This is mostly used when a new ERP5 site
+    is created. Some generators will need to do some initialization like
+    creating SQL Database, prepare some data in ZODB, etc
+    """
+
+  def clearGenerator():
+    """
+    Clear generators data. This can be usefull when working on a
+    development instance or in some other rare cases. This will
+    loose data and must be use with caution
+
+    This can be incompatible with some particular generator implementation,
+    in this case a particular error will be raised (to be determined and
+    added here)
+    """

Modified: erp5/trunk/products/ERP5/interfaces/id_tool.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/interfaces/id_tool.py?rev=33371&r1=33370&r2=33371&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/interfaces/id_tool.py [utf8] (original)
+++ erp5/trunk/products/ERP5/interfaces/id_tool.py [utf8] Thu Mar  4 09:43:50 2010
@@ -90,3 +90,33 @@
                               default=100, id_count=3)
        # this can returns ['154', '155', '156']
     """
+
+  def initializeGenerator(id_generator=None, all=False):
+    """
+    Initialize generators. This is mostly used when a new ERP5 site
+    is created. Some generators will need to do some initialization like
+    creating SQL Database, prepare some data in ZODB, etc
+
+    id_generator (string)
+       Select an particular id generator by giving its reference.
+
+    all (boolean)
+       do initialization for all generators
+    """
+
+  def clearGenerator(id_generator=None, all=False):
+    """
+    Clear generators data. This can be usefull when working on a
+    development instance or in some other rare cases. This will
+    loose data and must be use with caution
+
+    This can be incompatible with some particular generator implementation,
+    in this case a particular error will be raised (to be determined and
+    added here)
+
+    id_generator (string)
+       Select an particular id generator by giving its reference.
+
+    all (boolean)
+       do initialization for all generators
+    """




More information about the Erp5-report mailing list