[Zope3-Users] z3c.form: Integer-based fields incorrectly validated

Stephan Richter srichter at cosmos.phy.tufts.edu
Tue Aug 7 23:45:56 EDT 2007


On Wednesday 01 August 2007 13:15, Hermann Himmelbauer wrote:
> In one of my forms, one field is defined like that:
>
>     foobarid = Int(
>         title=u'ID',
>         description=u'ID of Foobar',
>         required=False)
>
> When I add this field in a z3c.form based form, e.g.:
>
> fields = field.Fields(IFoo['foobarid'])
>
> Then the validation of the field fails, e.g. if I type in a correct value,
> e.g. "123", zope returns an error:
>
> "The entered value is not a valid integer literal."
>
> Interestingly, if I set "1,123" as value, zope outputs:
>
> "Objekttyp ist falsch."
>
> I tried to investigate this futher, but things are getting complicated at
> the file "converter.py", line 96 (no clue what a formatter is).
>
> Is this a bug or am I doing something wrong?

This error should really not occur. I think we have plenty of tests for this 
and z3c.form is used in production using this feature. Can you extract this 
problem into a test?

Regards,
Stephan

PS: My wife insists that I should tell you that you have a great last 
name! :-)
-- 
Stephan Richter
CBU Physics & Chemistry (B.S.) / Tufts Physics (Ph.D. student)
Web2k - Web Software Design, Development and Training


More information about the Zope3-users mailing list