On Jan 8, 2008 8:45 AM, Glauco <[EMAIL PROTECTED]> wrote: > > > > 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
First: What would be the code to overload the validator.Int and include the empty_string =None? Second: Where would I put it? in controller.py? Lucas --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---

