[ZODB-Dev] ZODB and new style classes?

Mike C. Fletcher mcfletch@rogers.com
Wed, 26 Jun 2002 15:19:20 -0400


I've been using ZODB 4 (CVS checkout from the Zope-3x-branch and Zope3 
branch) Persistence + new-style classes for a few months now.  They 
work, but as has been mentioned before, the DB itself seems to have 
problems with invalidating objects that might be related to the changes 
for new-style classes.

object + Persistent does work
str + Persistent doesn't work AFAICS

As an option, I use the following pattern where I have objects that 
can't be stored normally (such as GUI pens, brushes and colours):

	define a basicproperty instance in the holders for the object with both 
_getValue and _setValue hooks that marshal/unmarshal the object to a 
simple tuple of construction values stored in the holder

Of course, that requires using ZODB4, which isn't a recommended activity 
at the moment I'm told :) .

Have fun all,
Mike

Ury Marshak wrote:
> Magnus,
> 
> When I asked this question some time ago I was
> pointed to the cvs with the Zope-3x-branch
> revision tag, but looking in the recent Zope3/
> comments about folding in that branch probably
> makes it the one to use with new-style classes.
> 
> FWIW, I tried using it (not extensively) and it seemed 
> to work, although I did not try to inherit from the
> standard classes... 
> 
> Ury
> 
> 
> 
> 
> _______________________________________________
> For more information about ZODB, see the ZODB Wiki:
> http://www.zope.org/Wikis/ZODB/
> 
> ZODB-Dev mailing list  -  ZODB-Dev@zope.org
> http://lists.zope.org/mailman/listinfo/zodb-dev
> 


-- 
_______________________________________
   Mike C. Fletcher
   http://members.rogers.com/mcfletch/