[ZODB-Dev] No module named Persistence
Laurence Rowe
l at lrowe.co.uk
Sun Dec 20 17:50:15 EST 2009
2009/12/20 Ross Boylan <RossBoylan at stanfordalumni.org>:
> The IPC10 presentation says
> #Works as a side-effect of importing ZODB above
> from Persistence import Persistent
>
> I tried that (with the indicate other imports first). It led to a "No
> module" error.
>
> I tried commenting out the line, since the comment could be interpreted
> to mean that importing ZODB already does what's necessary. But there
> was no "Persistent" class defined I could use.
>
> I tried from Globals import Persistent, as suggested in a 1998 posting.
> This produced "No module named Globals."
>
> Suggestions?
That is the old Zope2 persistence base class. Try 'from persistent
import Persistent'.
http://docs.zope.org/zodb/zodbguide/prog-zodb.html#writing-a-persistent-class
(note that guide has probably not been updated since ZODB 3.7, so
don't expect any newer features to be documented there).
Laurence
More information about the ZODB-Dev
mailing list