[Zope] Namespace confusion
Dieter Maurer
dieter@handshake.de
Wed, 14 Mar 2001 21:04:53 +0100 (CET)
Joel Burton writes:
> ....
> <adtml-call "REQUEST.set('id', 'discuss')">
> <adtml-call "REQUEST.set('title', 'Discussion Area')">
>
> <dtml-with "manage_addProduct['JDiscuss']">
> <dtml-call "JDiscuss_Folder_add( _.None, _)">
> </dtml-with>
>
>
> </dtml-with>
> ....
> The problem is that it overwrites the current values of title and id, so I
> can refer later to the book title and id.
>
> I've tried to do this like wrap the JDiscuss_add in <dtml-let> or
> <dtml-with> bands to supply a namespace for the title and id, but haven't
> been successful....
> would work, but it doesn't. (No error, just doesn't use the new id or
> title.)
Apparently, the "JDiscuss_Folder_add" only looks on "REQUEST"
and not on the namespace.
Do you have control over it?
Then, you may change it.
Otherwise, you may try
<dtml-let REQUEST="{ ... your assignments ...}">
....
<dtml-call "JDiscuss_Folder_add(_.None,_)">
</dtml-let>
May be difficult, as the true "REQUEST" is quite complex
and may be difficult to emulate in a dictionary sufficiently
for your "add".
Dieter