Re: [Zope-dev] Query on ZODB handling of class variables

2001-04-14 Thread Dieter Maurer

Bob Weiner writes:
 > ...
 > So how does one get class attributes (one attribute instance per class)
 > stored into and restored from ZODB?
I fear, it will not go.

  But, you can take the object from the class and
  put it as an object with a specific name (maybe
  derived from the class name) into the ZODB.

  The class would provide methods to access this object
  in ZODB.


Dieter

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



[Zope-dev] Query on ZODB handling of class variables

2001-04-13 Thread Bob Weiner

Hi all:

I'm doing some prototyping using the standalone version of ZODB from AMK (March 30, 
2001 release, the latest).  Things generally work as AMK has documented
them but one issue has cropped up on which I could use your feedback.  My reading of 
the ZODB code is that it uses pickling to store objects and the Python documentation 
on pickles say that classes are not pickled, only their names are.  I have a counter 
class which inherits from Persistent and contains a class attribute which needs to be 
persistent but seems to be the only thing in my system not restored when I reload my 
ZODB instance (and this jives with the pickle documentation). (If it matters, this 
class has an __getinitargs__
method but now __getstate__ or __setstate__ methods.)

So how does one get class attributes (one attribute instance per class)
stored into and restored from ZODB?  If this is not automatic, it would
seem that a __getclassargs__ type method might be required.  Or am I just
doing something wrong?

Also, if there is any documentation on how to debug ZODB sessions (I know there
are debugging conditionals built in but I haven't found any documentation.), I could 
use a pointer.

Thanks,

Bob


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )