[Zope] Send folder object from form to script

Dieter Maurer dieter@handshake.de
Thu, 25 Jul 2002 21:18:49 +0200


Kristofer Bengtsson writes:
 > How do I send a folder instance from a form to a script? When I test my 
 > script with this code outside a form its working fine:
There are no folder instances in a form!
Only ids or maybe paths of/for folder instances.

 > <div tal:replace="
 > python:here.addProject(python:here.projects.objectValues(['Folder','Plone 
 > Folder']))" />
What's that               ^^^^^^^?
I am sure, it is not there!


 > The script copys Page Templates from a list of folders and adds them to 
 > context.
 > 
 > Here is part of my form (what kind of Mime should i have?):
 > 
 > ...
 >   <metal:block tal:repeat="trx batch">
 > ...
 >             <input type="checkbox"
 >                    class="noborder"
 >                    name="proj:list" value=""
 >                    tal:attributes="value trx">
Do not try to send the object itself but its id or path!

Resolve it in the target script with either "getattr" or
"restrictedTraverse". To learn more, read

  <http://www.dieter.handshake.de/pyprojects/zope/book/chap3.html>



Dieter