[Grok-dev] Grok-1.2a released

Jan-Wijbrand Kolman janwijbrand at gmail.com
Fri Oct 8 02:44:46 EDT 2010


Hi Kevin,

On 10/8/10 2:43 AM, Kevin Teague wrote:
> Cool! Good to see all of the clean-up work on the zope dependencies
> that's gone into the ZTK finally landing in Grok.
>
> What's the recommended process for dealing with objects that have moved?
> Specifically, I'm assuming that I'm getting the following error:
snip
> Because of the move of the persistent session objects from
> zope.app.session to zope.session:
snip
> Is there an established way of fixing these objects?

Right, classes have moved. We need to deal with that, either in 
documentation and/or in a compatibility package (like Martijn has 
suggested a couple of times before).

Either way, the trick is basically this:

1) Get the original import-paths back (in this particular case by 
requiring zope.app.session in your specific project). zope.app.session 
will have backwards compatibility imports in place that will "un-break" 
your persistent objects.

2) Run the zodbupdate[1] tool. This tool will go through your database 
and by unpickling-and-then-pickling objects the new import paths to the 
class definitions will have been saved.

3) If this run has been successful, you should then be able to remove 
the requirements for the zope.app.session package again.

This is a very brief explanation, and the topic certainly deserves more 
attention. I hope you can get any further now.

Kind regards and thank you for your feedback.
jw

[1] http://pypi.python.org/pypi/zodbupdate



More information about the Grok-dev mailing list