[ZODB-Dev] Persisting oher stuff than persistent objects...

Christian Reis kiko@async.com.br
Wed, 26 Jun 2002 13:45:36 -0300


On Wed, Jun 26, 2002 at 05:25:28PM +0200, Magnus Lycka wrote:
> Is there another way to do this? If I just sub
> class str, can I still make these objects persist
> in ZODB? I can obviously make objects such as
> python lists persist... Can I get away with just
> setting "self._p_changed = 1" in the class that
> contains the object in question. That would work
> if it was a simple string I used. Might that work
> even if I use a sub class of string which has
> additional, mutable attibutes? (Assuming I manage
> to call "self._p_changed = 1" in the containing
> class when the mutable attributes change.)

You can wrap a string data object and override the usual methods to
provide an illusion of a persistent string class. Check out
PersistentList or PersistentDict for an idea on how to do it.

Take care,
--
Christian Reis, Senior Engineer, Async Open Source, Brazil.
http://async.com.br/~kiko/ | [+55 16] 261 2331 | NMFL