[Ann] copyPropertySheet
Zope's support for PropertySheets is very weak. They cannot be renamed or copied. They can be exported but only imported if they are empty. The reason for these restrictions: The property values are not stored in the sheet but in the associated v_self (value self). The persistence mechanism, on with copying, renaming and export is based, cannot find them in the current implementation. copyPropertySheet uses the specific PropertySheet interface to handle property values correctly. You can use it to copy a PropertySheet sheet into a container container and optionally give it a different id. sheet and container can be either strings or objects. Strings are resolved into objects with restrictedTraverse. container defaults to the sheets container. Download at URL:http://www.dieter.handshake.de/pyprojects/zope Dieter
And how do you use it? Can I just not plug it in and find that the Properties tab is golden and shiny?
Zope's support for PropertySheets is very weak. They cannot be renamed or copied. They can be exported but only imported if they are empty. The reason for these restrictions: The property values are not stored in the sheet but in the associated v_self (value self). The persistence mechanism, on with copying, renaming and export is based, cannot find them in the current implementation.
copyPropertySheet uses the specific PropertySheet interface to handle property values correctly. You can use it to copy a PropertySheet sheet into a container container and optionally give it a different id. sheet and container can be either strings or objects. Strings are resolved into objects with restrictedTraverse. container defaults to the sheets container.
Download at
URL:http://www.dieter.handshake.de/pyprojects/zope
Dieter
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Peter Bengtsson writes:
And how do you use it? Can I just not plug it in and find that the Properties tab is golden and shiny? It was my primary aim to enhance the Copy&Paste support such that it would be able to copy PropertySheets. I made some studies and quickly found out, that this would end in a major rewrite of the export/import/copy/paste mechanism. Something not in my reach, currently.
When you look at URL:http://www.dieter.handshake.de/pyprojects/zope you will see that "copyPropertySheet" is in the "External Methods" section. This indicates that it is used as an External Method ;-). After you installed it, you can either call it directly from the Web (as I do) or make a little form that asks for the parameters: sheet, container, id and then call the method. Dieter
participants (2)
-
Dieter Maurer -
Peter Bengtsson