#1033: validation isn't working as expected in MultipleSelectField
------------------------------+---------------------------------------------
Reporter: jerojasro | Owner: anonymous
Type: defect | Status: closed
Priority: normal | Milestone: 0.9a7
Component: Widgets | Version: 0.9a6
Severity: normal | Resolution: fixed
Keywords: widget validator |
------------------------------+---------------------------------------------
Changes (by alberto):
* status: new => closed
* resolution: => fixed
Comment:
Please try teh 1.0 branch since [1651] see if it solves your use-case. I'm
attaching a modified version of forms.tar.gz to show how it can be done.
The problem is (was) that the the MultipleSelectionField builds it's own
ForEach validator based on the one provided. The ForEach validator is the
one in charge of validating the list as a whole which is the only moment
we can see how many items are actually selected.
The proposed solution is to avoid this validatior-building if you provide
your own validator which *must* subclass validators.ForEach. Just don't
forget to initialize your ForEach subclass with the correct validator to
validate the list's items (in your case, an Int)
HTH,
Alberto
P.S Please reopen if I missed something.
--
Ticket URL: <http://trac.turbogears.org/turbogears/ticket/1033>
TurboGears <http://www.turbogears.org/>
TurboGears front-to-back web development
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears Tickets" 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-tickets
-~----------~----~----~----~------~----~------~--~---