[Zope3-Users] A question regarding zope generations

Bernd Dorn bernd.dorn at lovelysystems.com
Sat Nov 17 07:01:33 EST 2007


On 16.11.2007, at 13:56, Shailesh Kumar wrote:

>
> As of now, I am thinking of a following solution. For the current  
> upgrade, I will have some code which will automatically evolve the  
> existing installation during startup
> (i.e. DatabaseOpenedEvent) and actually assign a generation number  
> in the root[generations_key]['product_name'] key.
>
> In the later upgrades, I will replace this with the regular schema  
> manager.
>
> Comments from the zope 3 experts would be very useful.

well this is a real flaw with generations ...

in our projects we always add an initial .generations package to  
avoid such cases, you  can do this too, but it needs an intermediate  
version but no "dummy" schema manager.

in generations/__init__.py you add

from zope.app.generations.generations import SchemaManager

pkg = 'myapp'

schemaManager = SchemaManager(
     minimum_generation=0,
     generation=0,
     package_name=pkg)

and register the manager.

make a realease, this will set the generation to 0

then add your first "evolve1.py" to generations, the manager stays  
the same  - you only have to increase the generation number

regards, bernd





-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.zope.org/pipermail/zope3-users/attachments/20071117/8454ca25/attachment.htm


More information about the Zope3-users mailing list