Acquire/call script on object in ZPT repeat
Hello, I keep all my scripts in the subfolder root/scripts (is this a bad idea?). I'd like to call a particular script root/scripts/action on EACH object from the list mylist, which contains a list of folders located throughout the zope tree. I've tried variations on the following ZPT code, none of which work: <p tal:repeat="object mylist"> <div tal:content="object/scripts/action">Result of calling action on object</div> </p> The problem with the above is that action is called on the directory scripts, which is not what I want. How can I acquire action from each object? Any help from more experienced users would be greatly valued. Thanks! Christian
Gromoll, C. writes:
... I'd like to call a particular script root/scripts/action on EACH object from the list mylist, which contains a list of folders located throughout the zope tree. I've tried variations on the following ZPT code, none of which work:
<p tal:repeat="object mylist"> <div tal:content="object/scripts/action">Result of calling action on object</div> </p> <p tal:define="action nocall:object/scripts/action" tal:repeat="object mylist"> <div tal:content="python: action(object)"></div> </p>
This assumes, that the script expects "object" as argument. Dieter
participants (2)
-
Dieter Maurer -
Gromoll, C.