Q: what is the parameter "_.None" in calls to document templates?
Hi folks, When reading zope examples I came accross a lot of calls to document templates, which use "_.None" as the first parameter.
From the docs I understand that the first parameter should usually be the containing object, i. e., for a dtml method the folder it is found in. I'd expect the latter to work for me. But whatever I do I end up with some ununerstandable error message.
The problem: I have a folder hirarchy like that: common/Contacts docs Within the "common/Contacts" there are some DTML documents, one for each person. Those documents have properties like "surname" etc. There is also a dtml method "asOptions" like that: <dtml-in "objectValues('DTML Document')"> <option value="<dtml-var id
"><dtml-var firstname> <dtml-var surname </option> </dtml-in>
I tried to call that DTML method from within the "docs" folder, but the result I see is quite not what I want. I did: <selection name="xyz"> <dtml-call "common.Contacts.asOptions(_.None, _, REQUEST)"> </selection> This way no options at all are found. I also tried to modify the first parameter as "_", "common/Contacts" with errors like "KeyError: headers" and authorization faliure. Any help appreciated. Thanks a lot /Jerry -- You can have it done fast, you can have it done cheap, and you can have it done well. --- But you can only have two of those at once.
At 13:40 20/09/99 , Joerg Wittenberger wrote:
Within the "common/Contacts" there are some DTML documents, one for each person. Those documents have properties like "surname" etc.
There is also a dtml method "asOptions" like that:
<dtml-in "objectValues('DTML Document')"> <option value="<dtml-var id
"><dtml-var firstname> <dtml-var surname </option> </dtml-in>
I tried to call that DTML method from within the "docs" folder, but the result I see is quite not what I want. I did:
<selection name="xyz"> <dtml-call "common.Contacts.asOptions(_.None, _, REQUEST)"> </selection>
This way no options at all are found. I also tried to modify the first parameter as "_", "common/Contacts" with errors like "KeyError: headers" and authorization faliure.
Any help appreciated.
Thanks a lot
First, use dtml-var in stead of call, because call doesn't insert anything into your document. Second, you could also do: <dtml-with "common.Contacts"><dtml-var asOptions></dtml-with> -- Martijn Pieters, Web Developer | Antraciet http://www.antraciet.nl | Tel: +31-35-7502100 Fax: +31-35-7502111 | mailto:mj@antraciet.nl http://www.antraciet.nl/~mj | PGP: http://wwwkeys.nl.pgp.net:11371/pks/lookup?op=get&search=0xA8A32149 ------------------------------------------
participants (2)
-
Joerg Wittenberger -
Martijn Pieters