[Zope] attribute error: absolute_url
Casey Duncan
cduncan@kaivo.com
Mon, 18 Jun 2001 09:53:11 -0600
Dieter Maurer wrote:
>
> wazum-mail (wolfgang) writes:
> > ...
> > <dtml-if text_css_styles><link rel="stylesheet" type="text/css"
> > href="<dtml-var "text_css_styles.absolute_url ()">"></dtml-if>
> > ...
> > AttributeError: absolute_url
> That's a nasty side effect of the caching performed by
> many DTML tags:
>
> If you use "<dtml-if name=XXX ...>" (this is the explicit
> form of "<dtml-if XXX ...>"),
> then "XXX" is rendered and bound to the name "XXX".
> When you later access "XXX", you get the already rendered
> value.
>
> If "XXX" is (originally) bound to a DTML object (as in your case),
> then it is very likely that its rendered value is a string
> which (of course) does not have an "absolute_url" method.
>
> Dieter
>
Smells like a bug to me. IMHO caching should be entirely transparent to
the top-level behavior. But alas, our world is less than perfect.
I'm surprised I haven't run into this myself...
--
| Casey Duncan
| Kaivo, Inc.
| cduncan@kaivo.com
`------------------>