[Zope-dev] dtml-call problem
Michel Pelletier
michel@digicool.com
Sat, 08 Apr 2000 16:03:18 -0700
"Dr. Peer Griebel" wrote:
>
> Duncan Booth wrote:
> >
> > Try:
> > <dtml-call "method_b(_.None, _)">
> > and everything should be fine.
>
> Thank you. This works.
>
> > See also http://www.zope.org/Documentation/Guides/DTML-
> > HTML/DTML.5.6.2.html which explains exactly what these
> > arguments are, although not how to use them.
>
> This chapter of the document is titled "Using Document Templates from
> Python". So it is at least a little bit misleading since I'm using it in
> a Zope method...
>
> > Actually having read this, it looks (I haven't checked it) as though
> > you should also be able to write:
> > <dtml-call "method_b(mapping=_)">
> > which is arguably more readable.
>
> I think all these calling conventions are not intuitive at all.
You're right.
> Wouldn't
> it be better to have these parameters passed by default?
Yes.
> Perhaps it is
> difficult to implement. But a normal user has no reason to think about
> passing internal variables. All he sees are his own (dtml-)methods where
> he himself defines the list of parameters. So he never really sees the
> real definition of the method with all the 'hidden' parameters.
The problem is that python expressions were added after all of the
calling machinery was implemented. We never intended people to see
these method arguments. When we exposed calling method directly with
python expressions, the naked ugliness was revealed.
We're averse to just changing this straight out because it could break a
lot of stuff subtley. I seem to remember Jim mentioning something about
changing this, but I don't know the details.
In either case, you're wish will go unaswered unless you put it
somewhere where it will not flow down the list river never to wash
ashore again. How about putting it in the interfaces Wiki?
http://www.zope.org/Members/michel/Projects/Interfaces
under the InterfacesWishList?
-Michel