|
Re: how to deal with changes in package hierarchy?: msg#00055web.zope.zodb
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> |
|---|---|---|
| Previous by Date: | Attention: cvs to subversion transition May 11: 00055, Jim Fulton |
|---|---|
| Next by Date: | better job: 00055, Jaime Bledsoe |
| Previous by Thread: | how to deal with changes in package hierarchy?i: 00055, Garry Hodgson |
| Next by Thread: | better job: 00055, Jaime Bledsoe |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |