[Zope-dev] Why is TemplateDict so opaque? -and- Have youseen this
problem?
Dave Parker
dparker@globalcrossing.com
Thu, 16 Dec 1999 16:02:03 -0600
Jim Fulton wrote:
> Your analysis is flawed. Here's why. The method gets called
> recursively. The first time it is called, the namespace *is* passed
> in, by Zope. When it calls itself the second time, the namespace
> isn't there, because the method doesn't pass it. Lets work through this:
Blush - yup, you're right. So ok I guess I just have an "issue" in my
head then, which is...
> > It strikes me that someone
> > went to the effort to ensure that namespace gets passed down for me to
> > *some* extent,
>
> That's right. When a method is called by Zope or when you insert
> it with the name attribute of the var tag:
>
> <dtml-var name=methodA> (aka <dtml-var methodA>)
>
> The namespace is passed in for you.
...so why not take care of that for me *always*? You do it for me once,
why not just keep on doing it? Put another way, what's the benefit to
the user of parameterizing the namespace?
- It's not at all intuitive.
- In that I get namespace calling the function one way, but not another,
it's inconsistent and therefore confusing
- It adds a repetitiveness to the protocol that feels kludgy
- From an end-user perspective, I feel like I'm getting around a
*problem* with Zope's logic
So it's a "user friendliness" issue. But I can guarantee you I'm not
alone - we have a team of four doing heavy development in Zope and the
*resounding* complaint is that Zope is rife with these apparent
inconsistencies.
I'm close to being done beating this issue, but while "apparent
inconsistency" is in my head I'll thow out one I struggling with at this
moment:
If I do:
<dtml-var "myMethod(value={'this':'that'})">
myMethod does not see "value" in the namespace whereas if I do:
<dtml-var "myMethod(value=['this','that'])">
myMethod sees value just fine.
So I can't pass in mapping objects??
Sigh. This sort of thing is *extremely* frustrating to someone just
trying to crank out an app...
Thanks for you time, and I apologize for all this ranting - I've been
doing 18 hour days (at night).
Dave