[ZODB-Dev] Adopting ZODB
Paul Winkler
pw_lists at slinkp.com
Thu Jul 13 11:22:50 EDT 2006
On Thu, Jul 13, 2006 at 10:56:50AM -0400, Chris S wrote:
> I'm trying to adopt some code to use ZODB as its persistence level.
> I've read the "Writing a Persistent Class" article
> (http://www.zope.org/Wikis/ZODB/FrontPage/guide/node3.html#SECTION000350000000000000000)
> but how do you persist a class that already inherits another class?
> Does ZODB work with multiple inheritence?
Sure.
> Also, how should I persist
> objects in libraries beyond my control? For example, I'd like to
> persist instances of pyrobot.brain.conx.Network
> (http://pyrorobotics.org/?page=Building_20Neural_20Networks_20using_20Conx).
> Is there any ability in ZODB to retroactively wrap objects in a
> persistence mechanism instead of having to rewrite an entire library
> to use the Persistent class?
Write a wrapper. In the simplest case:
class PersistentFoo(somemodule.Foo, Persistent):
pass
--
Paul Winkler
http://www.slinkp.com
More information about the ZODB-Dev
mailing list