I am trying to add a zclass programmatically to a subfolder in another zclass - I've checked the archives and documentation, and haven't been able to figure this out. If I am inside ZClassA and want to create a new instance of ZClassB inside the folder 'bar' which is in ZClassA, it seems you would do something like this (from inside ZClassA): <dtml-with "manage_addProduct['DocumentAppProduct']"> <dtml-call "bar.ZClassB_add(_.None, _, NoRedir=1)"> </dtml-with> but I get an unauthorized error saying I don't have access to 'bar', even though the calling method has a manager proxy role.
----- Original Message ----- From: "Brett Carter" <bacarter@kavi.com> To: <zope-dev@zope.org> Sent: Tuesday, March 14, 2000 1:32 PM Subject: [Zope-dev] Adding zclasses to subfolders
I am trying to add a zclass programmatically to a subfolder in another zclass - I've checked the archives and documentation, and haven't been able to figure this out. If I am inside ZClassA and want to create a new instance of ZClassB inside the folder 'bar' which is in ZClassA, it seems you would do something like this (from inside ZClassA): <dtml-with "manage_addProduct['DocumentAppProduct']"> <dtml-call "bar.ZClassB_add(_.None, _, NoRedir=1)"> </dtml-with>
I believe this should actually be: <dtml-with "bar.manage_addProduct['DocumentAppProduct']"> <dtml-call "ZClassB_add(_.None, _, NoRedir=1)"> </dtml-with> or <dtml-with bar> <dtml-with "manage_addProduct['DocumentAppProduct']"> <dtml-call "ZClassB_add(_.None, _, NoRedir=1)"> </dtml-with> </dtml-with> Kevin
<dtml-with "bar.manage_addProduct['DocumentAppProduct']"> <dtml-call "ZClassB_add(_.None, _, NoRedir=1)"> </dtml-with>
or <dtml-with bar> <dtml-with "manage_addProduct['DocumentAppProduct']"> <dtml-call "ZClassB_add(_.None, _, NoRedir=1)"> </dtml-with> </dtml-with>
Kevin Actually, I tried this - doesn't the <dtml-with> tag just bring stuff into your namespace? So all this does is bring 'foo' in your namespace, and then add the zclass to where you are calling the above code from. -Brett
participants (2)
-
Brett Carter -
Kevin Dangoor