[Zope] Getting an objects properties

Jonothan Farr jfarr@real.com
Wed, 6 Oct 1999 09:59:09 -0700


> I have a prototype working in wich I use 'dir(self)' to get a list of
> all the properties of the object. It kinda works now, but I was
> wondering what the correct way is to get all the properties wich are
> stored for an object in de objectdatabase. Do I have to access them
> through the propertysheets ? And what happens then if I delete one from
> a propertysheet, while the object still has it stored?


Most objects that support properties are derived from PropertyManager, which
contains these methods:

    def propertyIds(self):
        """Return a list of property ids """

    def propertyValues(self):
        """Return a list of actual property objects """

    def propertyItems(self):
        """Return a list of (id,property) tuples """

    def propertyMap(self):
        """Return a tuple of mappings, giving meta-data for properties """

See the source for PropertyManager.py for more info.

-jfarr

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Hi! I'm a signature virus.
Copy me into your .sig to join the fun!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~