[Zope-dev] Using PropertySheet properties in Python-based DataSkin product

Itai Tavor itai@optusnet.com.au
Mon, 7 May 2001 11:53:47 +1000


Hi,

I'm building a custom DataSkin in a Python product, and I need to 
have different permissions for different properties. I've traced the 
way this is done in ZClasses but I'm not sure how to implement it in 
Python or what classes and methods to use.

First, there's DataSkinSheet, ZCommonSheet, and PropertySheet. Would 
a PropertySheet work on a Rack? The interfaces added by ZCommonSheet 
seem to be aimed at using it in a ZClass, so I guess they aren't 
needed, but the v_self method added by DataSkinSheet might be needed?

Then I need to assign permissions to the sheet. Do I modify the 
__ac_permissions__ of PropertySheet? I don't think I can use 
ZCommonSheet.manage_setPermissionMapping as it uses ZClass 
permissions mappings... or is there another way to do this?

Also, to add properties to the sheet, do I need to call _setProperty 
for each property in the class __init__ method? Or is there a 
simpler/quicker way?

TIA, Itai
-- 
--
Itai Tavor                      -- "Je sautille, donc je suis."    --
itai@optusnet.com.au            --               - Kermit the Frog --
-- "What he needs now is understanding... and a confederate victory" --
-- Dr. Jacobi, Twin Peaks         --