[Zope-dev] Python Based DataSkins and Propertysheets

Johan Carlsson johanc@torped.se
Mon, 12 Feb 2001 12:16:32 +0100


> > Ah, I see.=20
> > But why do I need SimpleItems, isn't PropertyManagers sufficient?
>=20
> It makes your class play nicely with Zope.
>=20
> So, it can work with DAV, be copied and pasted, properly work
> with traversal, work with ZDOM, be Owned, support undo, work
> with Acquisition, and manage roles.

Which isn't a bad thing.
At the moment I'm aiming at the lest amount of functionality.

Next thing I want to do is adding Zope-awareness and put
objects in a Folder/wCustomizer .
How hard is it to move a Simple Item DataSkin to a Customizer?

BTW. After I have done that successfully I intend to make the DataSkins
Plugins instead of Zope Items. That's the my goal at this point.

=20
> Take a look at the source to lib/python/OFS/SimpleItem.py

> You can omit some of this if you know for sure in advance that you
> will be using instances of your class only with Specialists in=20
> Racks.
>=20
> However, ZPatterns is set up so you can use the same DataSkin class
> with instances stored in a Rack or stored as normal Persistent objects
> in the ZODB.
>=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
> No it doesn't tie the object to the ZODB if you're using a Specialist.
> That's the magic of ZPatterns.

Ahhh, good.
Magic is a wonderful thing, but it also makes understanding a bit harder =
;-)


About the ZClass still of propertysheets, is that when I add a=20
OFS.PropertySheets.PropertySheets attribute to my object?
Can I use the OFS.PropertySheets.PropertySheets for that and
does it play with ZPatterns?

I use PropertySheets for allot of multi language support, storing
properties in separate languages PropertySheets.

Johanc