On Jan 8, 2008 2:11 AM, Glauco <[EMAIL PROTECTED]> wrote:
>
> Lukasz Szybalski ha scritto:
> > Hello,
> > Is there a reason widgets return 'null' instead of None, aka string vs 
> > NoneType?
> >
> > {"tg_flash": null, "kwargs": {"LastName": "CLARK", "XXXNo": null,
> > "searchtype": "Exact"}}
> >
> > Is this a bug? I think the None should be returned instead of null,
> > then one could test:
> > if kwargs['LastName']:
> >     #do stuff
> >
> > vs now I have to check for null or ' ' or ...etc?
> >
> > ???
> > Lucas
> >
> >
> >
>
> Try to check the empty_value function of your validator.
>
> you can pass this value to validator:
>
> empty_value = lambda x: None #example

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

>
>
>
>
>
> Glauco
>
>
>
>
>
> --
> +------------------------------------------------------------+
>  Glauco Uri
>  glauco(at)sferacarta.com
>
>           Sfera Carta Software(R)       info(at)sferacarta.com
>   Via Bazzanese,69  Casalecchio di Reno(BO) - Tel. 051591054
> +------------------------------------------------------------+
>
>
>
>
> >
>



-- 
-- 
VMware Server On Debian
http://wiki.debian.org/Manual-Howto#head-c9e998d4806797452cd58fce417b6fb00fbc60be
TurboGears from start to finish:
http://www.lucasmanual.com/mywiki/TurboGears

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