Commit 1ed36bc8 authored by Sebastien Robin's avatar Sebastien Robin

add API to initialize and clear generators

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@33371 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 10cb3f06
......@@ -76,3 +76,21 @@ class IIdGenerator(Interface):
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)
"""
......@@ -90,3 +90,33 @@ class IIdTool(Interface):
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
"""
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