New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MultipleSelectField preparation bug when PropertyLoader field is in __require_fields__ #4
Comments
Please do create an example if you can. Thanks Moritz. -chris |
Okay, done. See a standalone minimal working example here: (You could change |
It's also on runnnable (thanks to @amol- for showing that) http://runnable.com/VGNDePVfrxoeWy4x/minimal-working-example-to-demonstrate-issue-turbogears-sprox-4-for-python |
Note that there is an error in the example as it doesn't use an EditFormFiller so repr of the entities ends up being the value. I have been able to reproduce the issue in a test unit, it should have been fixed simply switching from UnicodeString to NotEmpty, have yet to check that no side effects appeared in real software |
The current code in sprox/formbase.py#L302-L304, leads to the problem that
PropertyLoader
fields that are in__require_fields__
will getUnicodeString
as their validator.Now if that
MultipleSelectField
has options that have one- and more-digit IDs, due to the widget using the validator to cast the list of selected values inself.value
to a unicode string, but to get the selected options, anin
operator is used.So, if the option with
id=13
would have to be checked, the options withid=1
andid=3
will also be checked.I'm too tired to put up a demonstrational exampe right now, but maybe it gets clear what the problem is. ;)
The text was updated successfully, but these errors were encountered: