[Zope] ZPT get_size question

Dieter Maurer dieter at handshake.de
Thu Feb 10 13:59:44 EST 2005


David Pratt wrote at 2005-2-9 16:28 -0400:
> ... loop ...
>...tal:define="file_size item/size" 
> ...
>AttributeError: size
> ...
>...tal:define="file_size item/get_size" 
> ...
>KeyError: 'get_size'

Apparently, you have object with a "size" attribute (lacking "get_size")
and (other) objects with a "get_size" attribute (but without "size).

You can use:	    "file_size item/size | item/get_size | nothing"
to account for these cases (and the one that you hit an object
without both "size" and "get_size").

-- 
Dieter


More information about the Zope mailing list