[Zope] Zope Products and keeping existing objects uptodate

Andreas Leitner nozone@sbox.tugraz.at
08 Jan 2002 05:07:05 +0100


On Tue, 2002-01-08 at 04:40, Craeg K. Strong wrote:
> What you are talking about is "schema migration"
> That is, migrating already existing instances of an object to a new 
> class definition.
> Here's how we did it:
> - Create a method in your class called "repair()"  It takes no 
> arguments, and makes all of the
>   changes necessary to change an old version to a new version.
> 
> - Create a "repairAll()" python script in the root folder
> 
> - execute the repairAll() script (easy way is to use the "test" tab). 
>  It recursively
> calls the repair() method on all instances of the class.
> 
> - presto!   All instances are now up to date.

Wow, that was quick. Thanks for your answere. Yes this is exactly what I
need. This solves my upgrade problem totaly.

Now, how do you guys do the actual development. I find it kind of
cumbersome to make a change in a dtml file of the Product, restart Zope
and repair (migrate) my test-instance.

I thought about changing the dtml file in the instance. This way I can
test the change immediatly. When I am happy with a certain change I can
just copy/paste the complete dtml file back to the Products dtml file
and only then restart Zope. Would this be practical, or are there other
better ways?


Andreas