[Zope] <dtml-with "portal_url.getPortalObject()"> gives
AttributeError
Marc Lindahl
marc at bowery.com
Tue Nov 11 11:31:19 EST 2003
Good point... how the heck to I get around it??
_.getattr('portal_url') or something?
On Sunday, November 9, 2003, at 03:22 AM, Dieter Maurer wrote:
> Marc Lindahl wrote at 2003-11-7 19:46 -0500:
>> I'm trying to keep around some legacy code, in zope 2.5.1 (CMF 1.3)
>>
>> trying to surround a block with <dtml-with
>> "portal_url.getPortalObject()"> so I reference root level folders. I
>> get the error:
>>
>> Error Type: TALESError
>> Error Value: exceptions.AttributeError on getPortalObject
>
> Almost surely, "portal_url" in not the object you expect.
> I expect it to be a string in the code above.
>
> Note that the "portal_url" object yields a string as soon
> as it is called. And it is *very* easy to call an object
> unintentionally both in ZPT and DTML.
>
> The code snippet above does not call "portal_url" but something
> in the context may already have when "portal_url" was bound.
>
> --
> Dieter
More information about the Zope
mailing list