On Sun, 22 Apr 2007 at 10:22, Jorge Godoy wrote:
> Nope.  The validator uses the same rules as Python itself, so if one
> thing evaluates to True in Python it will be True for the validator.
>
> Also remember that everything you get from the web is a string:
>
>>>> from turbogears.validators import Bool
>>>> v = Bool()
>>>> v.to_python(0)
> False
>>>> v.to_python("0")
> True
>>>> v.to_python('')
> False
>>>>

Um...isn't that broken?  I thought to_python was supposed to
convert a value from the string representation to the Python
representation.  In which case v.to_python('0') should be False, as
should v.to_python("False").  Or at least the latter...

--David

--~--~---------~--~----~------------~-------~--~----~
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