I'm making a Zope product (in python) where I want the users to have control over what properties that exist. At the same time I don't want the users to have to deal with having all properties in one big mess under the standard Property-tab. So, my question is then: Should I use the PropertySheets class for this, and if yes, does anybody have any example code, becuase it's not immediately obvious how to use it. Best Regards Lennart Regebro Torped Strategi och Kommunikation AB
Lennart Regebro wrote:
I'm making a Zope product (in python) where I want the users to have control over what properties that exist. At the same time I don't want the users to have to deal with having all properties in one big mess under the standard Property-tab.
So, my question is then: Should I use the PropertySheets class for this, and if yes, does anybody have any example code, becuase it's not immediately obvious how to use it.
I think it should work well with PropertyManager Usage (works for me): - Define your own edit form - Derive your class from PropertyManager - Add a propertysheet to a class instance, eg.: def __init__(self): self.propertysheets.manage_addPropertySheet('advanced', 'advanced') - Add a prop: advanced.manage_addProperty('something', 0, 'int') - Do something with your propsheet, eg. update it: adv = self.propertysheets.get('advanced') if REQUEST is not None: return self.manage_advancedForm( REQUEST, manage_tabs_message='Advanced Settings updated.', ) - Or read a property: self.propertysheets.get('advanced').something If you're having problems just shout. cheers! peter.
Best Regards
Lennart Regebro Torped Strategi och Kommunikation AB
_______________________________________________ Zope-Dev maillist - Zope-Dev@zope.org 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 )
From: "peter sabaini" <sabaini@inode.at>
I think it should work well with PropertyManager
Thanks, I got a lot further now. Still some things before I'm done though:
- Define your own edit form
How do I do that? The default edit form /propertysheets/name/manage works well, but doesn't have any management tabs. I've done a lot of experimenting, but everytime I get management tabs I also get the default properties, no matter what view I'm on... Best Regards Lennart Regebro Torped Strategi och Kommunikation AB
participants (2)
-
Lennart Regebro -
peter sabaini