[Zope-dev] Python Based DataSkins and Propertysheets
Johan Carlsson
johanc@torped.se
Mon, 12 Feb 2001 10:57:32 +0100
> > But as I noticed the "properties" was saved as
> > attributes not as properties in a propertysheet.
>=20
> That's another way of doing it. It is a bit less transparent.
> I find it more straightforward to make my classes SimpleItems
> and PropertyManagers, as it means I can just call
> manage_changeProperties() without writing extra methods.
Ah, I see.=20
But why do I need SimpleItems, isn't PropertyManagers sufficient?
=20
=20
> There are two kinds of PropertySheet in Zope:
> DAV propertysheets
> Propertysheets that go with ZClasses
>=20
> There are also Properties for objects that are PropertyManagers,
> such as DTML Documents.
>=20
> There is an important difference in how these different types of=20
> properties work:
>=20
> DAV Propertysheets are independent Persistent objects
>=20
> Propertysheets that go with ZClasses and also
> PropertyManager propertysheets are stored as attributes
> in the objects they belong to.
>=20
> Therefore, in ZPatterns, you use AttributeProviders to do stuff
> with PropertyManager properties and ZClass-style propertysheets.
>=20
> You use SheetProviders to do stuff with DAV Propertysheets.
>=20
> If you're using ZClass-style propertysheets, you need to use
> DataSkin Attribute Propertysheets, rather than the default
> Common Instance Propertysheets.
>=20
>=20
> In your case, I suggest making your class Persistent, and using
> PropertyManager properties.
But making it presistent doesn't that lock the objects to be stored in =
the ZODB?
I may want to change storage to SQL later.
=20
> The reason to use ZClass-style propertysheets is if you want to=20
> easily partition your properties into sets of properties with
> different permissions.
Still confused but on a higher level ;-)
Johan