[Zope] [solved] formulator not reproducing its own results

Troy Farrell troy@entheossoft.com
Sat, 03 May 2003 17:26:27 -0500


Getting there.

try this:

actitle python:int(request.field_actitle) or None;

Troy

martin f krafft wrote:
>>Do you know what the python-equivalent of atoi() is? I have an
>>idea...
>>
>>[...]
>>
>>I don't think it's this way around. I think formulator is fine
>>dealing with integers, but Zope interferes with strings... So i need
>>to atoi()...
> 
> 
> Ha, got it! atoi() aka int() it was. If I convert the
> request/form/field_actitle to an integer like so:
> 
>   actitle python:int(request.field_actitle)
> 
> the whole thing works like a charm.
> 
> Score!!!!
> 
> I used to have
> 
>   actitle request/form/field_actitle|nothing
> 
> but postfixing |nothing to the python script above produces an
> error. Do you know how I can do the equivalent?
> 
> I tried
> 
>   python:test(request.has_key('field_actitle'), field_actitle, nothing)
> 
> but then, when field_actitile is missing, Zope complains about the
> unresolved name.
>