[Zope] Help: dtml-var expr -> DTML method -> ZSQL method
Mayers, Philip J
p.mayers@ic.ac.uk
Mon, 12 Feb 2001 17:48:08 -0000
Oops, my bad - REQUEST just contains the CGI/HTTP REQUEST variables, like
form variables, cookies, AUTHENTICATED_USER and so on. '_' consists of
"REQUEST" along with the Zope container hierarchy down to the given method.
So REQUEST is not expected to work. It *is* still a namespace, just not one
that contains the other DTML methods/folder/etc.
Sorry for the confusion!
Regards,
Phil
+----------------------------------+
| Phil Mayers, Network Support |
| Centre for Computing Services |
| Imperial College |
+----------------------------------+
-----Original Message-----
From: Andrews, Martin [mailto:mandrews@netgenics.com]
Sent: 12 February 2001 17:10
To: 'Mayers, Philip J'; 'zope@zope.org'
Subject: RE: [Zope] Help: dtml-var expr -> DTML method -> ZSQL method
I was pretty sure the problem was that I was losing context when calling
get_rid() - but for the life of me I cannot figure out how to pass it on -
trying:
<dtml-var expr="get_rid(_.None, REQUEST)">
still gives me the NameError for next_rid - but the first one works:
<dtml-var expr="get_rid(_.None, _)">
Anyone care to illuminate me as to why (what am I doing with the call above?
Thanks,
Martin
> -----Original Message-----
> From: Mayers, Philip J [mailto:p.mayers@ic.ac.uk]
> Sent: Monday, February 12, 2001 5:45 AM
> To: 'Martin Andrews'; 'zope@zope.org'
> Subject: RE: [Zope] Help: dtml-var expr -> DTML method -> ZSQL method
>
>
> The DTML method call:
>
> <dtml-var expr="get_rid()">
>
> Will call get_rid without a "namespace", so get_rid can't
> lookup next_rid,
> and therefore it fails. Try this:
>
> <dtml-var expr="get_rid(_.None, _)">
>
> Try the Zope "Help" link from the management interface, go
> "Zope Help",
> "Zope API", "DTML Method", and lookup the API for __call__:
>
> __call__(client=None, REQUEST={}, **kw):
>
>
> So, clearly this will work:
>
> <dtml-var expr="get_rid(_.None, REQUEST)">
>
> Namespaces are hard!
>
> Regards,
> Phil