[Zope] The funny _.None,_ feature in DTML kind of question
Shalabh Chaturvedi
shalabh@pspl.co.in
Thu, 1 Jun 2000 16:39:22 +0530
There is some more information at
http://www.zope.org/Documentation/How-To/AdvancedDTML
Look for the section "DTML Calling Arguments".
Reading that left me a bit confused because here you say (and I have read
elsewhere too) that method is passed client=_.None. I thought that the client
should be the object on which the dtml method 'operates'. So how does the dmtl
method access the attributes of the object it is called upon? Is it because the
namespace object '_' has the namespace of the object on top?
Any example of where the client parameter would be useful?
Thanks,
Shalabh
----- Original Message -----
From: Vitaly Osipov <vos@telenor.cz>
To: Johan Carlsson <johanc@torped.se>; <zope@zope.org>
Sent: Thursday, June 01, 2000 3:50 PM
Subject: Re: [Zope] The funny _.None,_ feature in DTML kind of question
> Everything is more or less simple - when you invoke method by <dtml-var
> meth1> - that "mapping" _ and "client" _.None are passed automagically :)
>
> when you invoke method with explicit arguments like <dtml-var "meth1()">,
> you have to pass those two explicitly like <dtml-var "meth1(_,_.None,...)">
>
> details are here:
>
> http://lists.zope.org/pipermail/zope/2000-January/017687.html
>
> ----- Original Message -----
> From: "Johan Carlsson" <johanc@torped.se>
> To: <zope@zope.org>
> Sent: Thursday, June 01, 2000 12:43 AM
> Subject: [Zope] The funny _.None,_ feature in DTML kind of question
>
>
> > Hi,
> > This feature really bugs me so I thought I
> > write a Tips (or HOWTO). But I need some help.
> > (Also I believe it's documented somewhere, but
> > I cant figure out where...)
> >
> > When calling the a DTML-method the second time
> > in a row the namespace just disapears.
> >
> > Using _.None and _ as begining arguments make
> > it all work again.
> >
> > The questions are:
> > -Why does DTML act like this, is there a logical explanition?
> > -Where is this documented? (I know I say it somewhere)
> > -What would be the best way to name and categorise this "feature".
> >
> > Best Regards,
> > Johan Carlsson
> >
> >
> > If you understand my brief problem description,
> > here's a scenario:
> >
> > In /folder1
> > there is three DTML-methods: meth1, meth2
> > In /folder1/folder2
> > there is a fourth DTML-method: meth3
> >
> > /folder1/meth1:
> > <dtml-with folder2> #changes the namespace
> > <dtml-call "meth3()"> # works just fine
> > </dtml-with>
> >
> > /folder1/meth2:
> > <dtml-call "meth1()"> #doesn't work
> >
> > /folder1/folder2/meth3:
> > <dtml-var "'hällå wörld'"> # or something useful like hello foobar
> >
> >
> > Solution:
> >
> > In /folder1
> > there is three DTML-methods: meth1, meth2
> > In /folder1/folder2
> > there is a fourth DTML-method: meth3
> >
> > /folder1/meth1:
> > <dtml-with folder2> #changes the namespace
> > <dtml-call "meth3(_.None,_)"> # works just fine
> > </dtml-with>
> >
> > /folder1/meth2:
> > <dtml-call "meth1(_.None,_)"> #works like a working thing
> >
> > /folder1/folder2/meth3:
> > <dtml-var "'hällå wörld'"> #or something useful like hello foobar (oh,
> it the same...)
> >
> >
> >
> > _______________________________________________
> > 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 )
>
>
> _______________________________________________
> 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 )
>