[Zope] Loosing namespace when calling a DTML-Method

Chris McDonough chrism@digicool.com
Tue, 01 Feb 2000 19:58:58 -0500


For reasons currently beyond my scope of understanding, you need to call
DTML methods in the following manner:

<dtml-var expr="my_other_dtml_method(_.None, _, food1='eggs',
food2='spam')">

The important parts are the _.None and the _ arguments before any other
passed-in stuff.

This is a really common problem, and I should really go write a how-to. 
But first I gotta be able to justify why you need to do this.  Time to
hit the archives.


Bertl wrote:
> 
> Hi, people!
> 
> I'm a Zope newbie and have a big big problem which i could not find
> anything about on the lists. I'm using the zope package that comes with
> debian linux potato (2.1.2) and the problem is the following:
> 
> When i call a DTML Method with dtml-var or dtml-call, the called method
> cannot access any object. Not REQUEST, not an with dtml-let or
> dtml-with assigned variable, nothing. Further the called method cannot
> access any Objects in it's own folder, even when i wrap it with <dtml-with
> folder> (which is just the same problem).
> Accessing the same variables inside the calling function works just like
> expected. When i change the DTML Method to a DTML Document, it cannot
> access variables from outside, but gets an Authentication error when
> accessing objects in the current namespace
> 
> My current workaround is to code everything in Python, as this works just
> great or to do everything in one big DTML Method. But this is not a long
> term solution!
> 
> I see two possible explanations for this phenomenon: i totally
> misunderstand the Zope-security model, which is not unlikely, or my Zope
> installation is buggy. (I hope it is the first one as i dont feel like
> installing a full featured Zope with PostgresSQL binding and dont want to
> wait for the 2.1.3 .deb)
> 
> Has anybody an idea what's going on?
> 
> thx,
> bertl
> 
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )

-- 
Chris McDonough
Digital Creations, Inc.
Zope - http://www.zope.org