[Zope] periods in objects - like picture.jpg

John Schinnerer johnschinnerer@yahoo.com
Thu, 16 May 2002 19:19:12 -0700 (PDT)


Howdy,
...
> > ...but it appears that zope has some kind of problem accessing an
> > attribute of an object with a dot in the object name,  e.g.
> > picture.jpg, whether in dtml or python script...??
> 
> funny, <dtml-var picture.jpg> works fine for me.

Yeah, that works fine, or equivalent in TAL, but I'm trying to get the
height and width attributes.  I tried some python scripting too but
couldn't get it to work.  I expect I've got syntax errors at the root
of it.  
 
> In python:
> 
> getattr(your_container,'picture.jpg').title
> ...with give you the title of the image.

So 

getattr(your_container,'picture.jpg').height

will get me the height...?

> PS: Learn ZPT, save yourself pain and suffering ;-)

I actually started out with zope using ZPT pretty much exclusively (got
into zope right about when ZPT product matured, apparently).  There's
plenty of opportunity for pain and suffering in trying to do anything
in TAL that there's not a clear and documented example for, and there
are IME precious few documented examples (so far) except for the most
basic stuff.  So I've taken to calling DTML methods and simple python
expressions (because I don't understand complex python stuff yet) in my
page templates to get more complex things done.

I'll be back in a while with some code...

cheers,
John S.



__________________________________________________
Do You Yahoo!?
LAUNCH - Your Yahoo! Music Experience
http://launch.yahoo.com