[Grok-dev] Re: releasing 0.12.1

Philipp von Weitershausen philipp at weitershausen.de
Wed Jun 4 08:56:11 EDT 2008

Sebastian Ware wrote:
> 4 jun 2008 kl. 12.41 skrev Raphael Ritz:
>> Tim Terlegård wrote:
>>> On May 30, 2008, at 4:16 PM, Philipp von Weitershausen wrote:
>>>> Jan-Wijbrand Kolman wrote:
>>>>> * Is there anything 0.12.1 can do to prevent Sebastian's "__iro__" 
>>>>> problem?
>>>> Grok should continue to depend on zope.app.securitypolicy and 
>>>> zope.app.session, so that old pickles continue to work.
>>> This is a disadvantage with object databases, classes can't be moved 
>>> around
>>> easily.
>>> Is there some script that can change class paths in the zodb? Or do you
>>> have you write your own migration code everytime you change
>>> my.model.SomeModel to my.models.SomeModel?
>> You can provide module aliases but that's about it ...
>> Alternatively, one could look into providing some
>> dump/load capability via a neutral format like what
>> GenericSetup does for CMF site configurations or
>> what we are looking into for Plone content at the moment.
>> Raphael
> - dump/load would be a great feature!
> - "retyping" objects on load/in place would be a great feature! (maybe 
> the latter can be done already?)

Yup. When you've provided module aliases or BBB imports, the ZODB will 
be able to load pickles properly. When you change the resulting objects 
so that they have to be re-pickled, the ZODB will use the *new* location 
of the class.

It is therefore sufficient to loop over all relevant objects (whose 
classes have moved) and simply do:

     obj._p_changed = True

More information about the Grok-dev mailing list