[Zope3-Users] updating objects in ZODB

Lorenzo Gil Sanchez lgs at sicem.biz
Fri Feb 10 05:15:36 EST 2006


Hi,

I have a question about updating the objects in a ZODB. Suppose I 
already have 100 objects of class A and then I modify class A adding a 
new attribute. Then I craete a new object of the class A and now I have 
two kind of instances of my class A, the old ones and the new one.

How do I update the old objects and add the new attribute to them? I can 
provide a default value for this attribute if that helps.

I guess changing the methods of the class A is not a problem since those 
are not stored in the database.

I know this is a common issue with application updates. I also know that 
during the development phase the best thing I can do is remove the 
Data.fs file and start again and that's what I'm currently doing. But 
I'm worried about installing the application in the client machines and 
two month later needing to add more fields to my content-types. If I 
understand correctly one of the advantages of Zope3 is the support for 
always-changing-applications. So how does it work in this particular 
situation?

Any pointer to documentation about this or to an example application 
that does this will be very helpful.

Thanks in advance

Lorenzo Gil


More information about the Zope3-users mailing list