> Pass it like this?
> XXXNo = widgets.TextField(validator=validators.Int(empty_value =
> lambda x: None))
>
> I still get xxxNo: 'null'
>
> Could you tell me what is the proper way of passing the empty_value to
> the walidator?
>
> Lucas
>
>
Hi Lucas, probably you are in this situation:
some js put a null value in your input field ---> string 'null'
your validator can't see this as an empty value
3 solutions :
1) (best) don't put in an integer field a 'null' value (null as string)
2) You must write your own validator, derivated from Int but 'null'
return None
3) You can validate your field as validator=validators.String after
that you can handle manually in your destination controller this field.
PS: that is the proper way to use empty value
Glauco
--
+------------------------------------------------------------+
Glauco Uri
glauco(at)sferacarta.com
Sfera Carta Software® info(at)sferacarta.com
Via Bazzanese,69 Casalecchio di Reno(BO) - Tel. 051591054
+------------------------------------------------------------+
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---