[Zope] Re: . in Object ID (was Newbie dtml-var question (probably...))

Kevin Dangoor kid@kendermedia.com
Wed, 16 Feb 2000 13:23:39 -0500


----- Original Message -----
From: "Geir B Hansen" <geirh@funcom.com>
To: "Chris Withers" <chrisw@nipltd.com>
Cc: <zope@zope.org>
Sent: Wednesday, February 16, 2000 7:20 AM
Subject: Re: [Zope] Re: . in Object ID (was Newbie dtml-var question
(probably...))


> on Wednesday, February 16, 2000 Chris Withers wrote :
> >> How about renaming niplogo.gif to niplogo and trying it that way
> >> (what you're trying to do when you do <dtml-var
> >> "PARENTS[-1].project.images.Niplogo.gif"> is get the attribute '.gif'
> >> from the object Niplogo). In other words, you need to get away from
> >> using the extension....
>
> CW> Unfortunately I have a hidden agenda here... While that would be fine
for
> CW> images, I was wondering about using this technique to solve my other
problem:
>
> if you desperately need the extensions, i think your only
> way out is to use plain DTML instead of python expressions:
>
> <dtml-with project>
> <dtml-with images>
> <dtml-var niplogo.gif>
> </dtml-with>
> </dtml-with>

Don't forget getattr if you want to use python expressions:

<dtml-var "_.getattr(PARENTS[-1].project.images, 'Niplogo.gif')">

Kevin