[Zope] how to check attribute or property of a object ??

Andreas Jung Andreas Jung" <andreas@zope.com
Wed, 28 Nov 2001 08:20:08 -0500


works for :

- i created an image object 'go.gif'
- zope created automatically properties for 'width' and 'height'
- <dtml-var "_['go.gif'].getProperty('width')"> return the right value
  of the width property

Maybe you must use the underscore notation when your object Id contains
special characters like a dot etc.

Andreas
----- Original Message ----- 
From: "zopist" <zopist@rediffmail.com>
To: "Andreas Jung" <andreas@andreas-jung.com>
Cc: <zope@zope.org>
Sent: Wednesday, November 28, 2001 08:00
Subject: Re: Re: [Zope] how to check attribute or property of a object ??



Thanks Andreas for the feedbacf.
But i am getting an error.

Error type : Attribute error
Error Value: getProperty

regards,
Zopist.

On Wed, 28 Nov 2001 Andreas Jung wrote :
> <dtml-if expr="objectname.getProperty('width')>640">
> Big image
> <dtml-else>
> Small image
> </dtml-if>
> 
> Andreas
> ----- Original Message ----- 
> From: "zopist" <zopist@rediffmail.com>
> To: <zope@zope.org>
> Sent: Wednesday, November 28, 2001 06:26
> Subject: [Zope] how to check attribute or property of a 
> object ??
> 
> 
> 
> hello,
> Every dtml-image object has width and height as a 
> default property.
> I want to check if a dtml image object has 
> width (attribute or property) > 1
> something like
> <dtml-if expr="objectname.len('width')>1">
> do something
> <dtml-else> do something else
> </dtml-if>
> can anybody please tell me the exact syntax ??
> can i use len ??
> thanks for the help. 
> 
> 
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists - 
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )
> 
> 
>