Re: [Zope] Directories and subdirectories....
After Dark writes:
"_.getitem('parameter')" is equivalent to "parameter".
parameter come from a form(REQUEST), so if I don`t do that zope will treat it like a string. But then, you must omit the '...'!
Believe me: "_.getitem('parameter')" is equivalent to "parameter". Thus, you should use: "_.getitem(parameter).objectValues()"
Otherwise, your statement is strange.
What object type contains the "dtml-in" (a DTML Method or Document)?
Dtml Document. That may explain why you get a wrong object:
A DTML Document brings with it its own context and this context is stronger than that of the call. If you have /parameter /document /subfolder /parameter and you use the URL "/subfolder/document", you will get "/parameter" and not "/subfolder/parameter". A DTML Method, on the other hand, does not bring its own context. I only uses that of the call. Check out URL:http://www.dieter.handshake.de/pyprojects/zope/book/chap3.html for details. Dieter
Hi. I did what you said,and everything worked, unless that zope don`t recognize the subfolder like an object. Even using a dtml-method and changing the expression, like you told me, it only works with the root folders. I tried (just to test) to do this: <dtml-in "rootfolder/subfolder.objectVlues()"> </dtml-in> and gives error of: trying to reference a nonexisting object or variable. I looked at the books, but I couldn`t solve it. Can you help? Thanks. On Fri, 30 Mar 2001 23:00:54 +0200 (CEST) Dieter Maurer <dieter@handshake.de> wrote:
After Dark writes:
"_.getitem('parameter')" is equivalent to
"parameter".
parameter come from a form(REQUEST), so if I don`t do that zope will treat it like a string. But then, you must omit the '...'!
Believe me: "_.getitem('parameter')" is equivalent to "parameter".
Thus, you should use:
"_.getitem(parameter).objectValues()"
Otherwise, your statement is strange.
What object type contains the "dtml-in" (a DTML Method or Document)?
Dtml Document. That may explain why you get a wrong object:
A DTML Document brings with it its own context and this context is stronger than that of the call.
If you have
/parameter /document /subfolder /parameter
and you use the URL "/subfolder/document", you will get "/parameter" and not "/subfolder/parameter".
A DTML Method, on the other hand, does not bring its own context. I only uses that of the call.
Check out
URL:http://www.dieter.handshake.de/pyprojects/zope/book/chap3.html
for details.
Dieter
________________________________________________ Don't E-Mail, ZipMail! http://www.zipmail.com/
After Dark writes:
... Zope don`t recognize the subfolder like an object .... <dtml-in "rootfolder/subfolder.objectVlues()"> </dtml-in> Apparently, you do not yet know the searchable list archives nor
URL:http://www.dieter.handshake.de/pyprojects/zope/book/chap3.html This is really an FAQ. I answered simlilar questions at least half a dozen times.... Use "restrictedTraverse" to access objects that are not in reach with acquisition.... Inside a Python expression (i.e. inside "...") is "/" the division operator! You try to divide "rootfolder" by "subfolder" and you get what you should get: a "NameError" (maybe "KeyError"). Some background reading recommended... Dieter
participants (2)
-
After Dark -
Dieter Maurer