[ZPT] Accessing class attribute from ZPT

Dieter Maurer dieter@handshake.de
Thu, 17 Jan 2002 23:49:45 +0100

John Morton writes:
 > I have a product that contains a class called ITProfile which has a class 
 > attribute called default_profession_types which is used to fill a select box 
 > when editing instances of the class. I want to be able to access those 
 > defaults from a page unrelated to the product directly; a customized search 
 > page as it happens. 
Your options:

  *  access them via an instance

  *  search the mailing list archives: you will find an
     (unintuitive) solution (from me) to access the attribute
     inside the class
 > ....
 > That attribute needs to be used by search pages and needs to have an 
 > interface for updating it for the entire class. Does anyone have a good Zope 
Such modifications are lost when Zope restarts.

Like many other so called OODBs, ZODB is *NOT* a true object oriented
database but just an object state database. It manages only the state,
it does not store the classes. Any changes to classes are lost
after a restart (This does not apply to ZClasses, which are
objects and behave like classes).