On Dec 7, 8:16 am, remi jolin <[EMAIL PROTECTED]> wrote:
>
> > @validate(validators={"newAmount": validators.Int()})
>
> You should try with adding not_empty = True as a parameter to Int like
> this :
>
> @validate(validators={"newAmount": validators.Int(not_empty=True)})

Thanks for the reply (and Glauco too).

I think the documentation should be changed though! Currently it says
"If it passes validation, tg_errors won't change from it's default
value of None and you are assured that value will be an int.", but it
passed validation and None is not an int. I note also that the page
doesn't discuss the 'not_empty' parameter: it just slips it silently
into an example without comment. Perhaps someone could add a sentence
or two on this?

--
Ben Sizer

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to