2009/9/14 andrei <[email protected]>:
>
> I consider Checkbox implementation is broken now, because
>
> 1. I can't create Checkbox without value like this:
>
>  from web import form
>  item_form =  form.Form(form.Checkbox("chk"))
>
>
> 2. If I create form this way and try to validate it against the data
> that has no value for the Checkbox:
>
>  from web import form
>  item_form =  form.Form(form.Checkbox("chk", value="on"))
>  if item_form.validates(dict(abs="rr")):
>      print item_form.d
>
> <Storage {'chk': "on"}>
>
> Then item_form.d still has the value for "chk", but in case of
> inserting item_form.d in database, it needs to be None if the Checkbox
> wasn't checked. Well, it worked for me in the version before I did:
>
> from web import form
> item_form =  form.Form(form.Checkbox("chk"))
> if item_form.validates(dict(abs="rr")):
>    print item_form.d
>
> <Storage {'chk': None}>

Try now. Fixed both.

http://github.com/webpy/webpy/commit/e8fe53871d3f5ee99213178e563ee09773ec0e5a

Anand

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web.py" 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/webpy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to