periods in objects; i.e. hostnames, IPs, etc
Can someone take a look at this- regarding periods in object names Generally I would "_['hostname']", but there are already double quotes for the zsql object call- <dtml-in "qrySelectKey(sqlTable=sqlTable, sqlKey=_['sqlKey'], sqlKeyStr=_['hostname'])"> ... </dtml-in> the above fails finding the object named by the first portion of the hostname (up to the period) thanks in advance Chas. mailto:c3w@juicypop.net JuicyPOP, Inc.
Aloha, Not an answer, but a similar question - in general how does zope ID, such as (in my case) image files with IDs like picture.jpg, logo.gif, etc.? I have been trying to access image size attributes of image objects, 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...?? thanks, John S. __________________________________________________ Do You Yahoo!? LAUNCH - Your Yahoo! Music Experience http://launch.yahoo.com
John Schinnerer wrote:
Aloha,
Not an answer, but a similar question - in general how does zope ID, such as (in my case) image files with IDs like picture.jpg, logo.gif, etc.?
I have been trying to access image size attributes of image objects, 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. In python: getattr(your_container,'picture.jpg').title ...with give you the title of the image. cheers, Chris PS: Learn ZPT, save yourself pain and suffering ;-)
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
participants (3)
-
Chas Wareing -
Chris Withers -
John Schinnerer