[triangle-zpug] Quick help w/a python statement

Stephanie Thirolle stepht at duke.edu
Wed Oct 21 14:23:54 UTC 2009

Hey All,
    I'm a relative python newbie and the following is driving me crazy.  
If anyone has ANY suggestions, I'd be most grateful.

I've got a FileField called 'execsummlink'  and I want to test if the 
field contains a file (or was left blank).  I've tried the following, 
but no matter what I do, I get a 'true' result regardless of whether the 
field contains anything:

tal:condition="python: len(execsummlink) > 0"
tal:condition="python: exists('here/execsummlink')"
tal:condition="python: hasattr(here, 'execsummlink')"
tal:condition="python: getattr(here, 'execsummlink')"

ALL of these work with other field types (Image, string, text, etc) -- 
any ideas why they won't work with a file field and what will???

Thanks SO much for your time.


Stephanie Thirolle
Director of Web Projects
Nicholas School of the Environment
Duke University

stepht at duke.edu



More information about the triangle-zpug mailing list