logo       

Re: how to deal with changes in package hierarchy?: msg#00055

web.zope.zodb

Subject: Re: how to deal with changes in package hierarchy?

Garry Hodgson wrote at 2004-5-10 10:40 -0400:
>a colleague of mine is using zodb/zeo for an application.
>while she used to store her python modules in a private
>directory, she has recently changed to installing them in
>a package under site-packages. i.e., where she used to:
>
> import reportStore
>
>she now does:
>
> import fathom.reportStore as reportStore
>
>the problem is, here existing zodb has the old reportStore
>objects in it, and fails when she tries to get one out:

This is something difficult as both the object itself as well
as references to it contain the class location (as a Python dotted path).

Avoid changing the module hierarchy.

If this is impossible, use "redirecting" modules, e.g.

reportStore.py:
from fathom.reportStore import *


You can add aliases into "sys.modules", e.g.

sys.modules['reportStore'] = sys.modules['fathom.reportStore']


Someout suggested to use an XML export, then change all class
references with a text editor and import it again.
You will loose all history information and information
about the last modification time (this will become the import time).

--
Dieter

_______________________________________________
For more information about ZODB, see the ZODB Wiki:
http://www.zope.org/Wikis/ZODB/

ZODB-Dev mailing list - ZODB-Dev@xxxxxxxx
http://mail.zope.org/mailman/listinfo/zodb-dev



<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise