Created
March 28, 2012 12:26
-
-
Save domenkozar/2225789 to your computer and use it in GitHub Desktop.
Using Integer type with SelectWidget renders wrong selected values
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import deform | |
import colander | |
class TestSchema(colander.MappingSchema): | |
list = colander.SchemaNode(colander.Integer(), | |
widget=deform.widget.SelectWidget(values=[(1, 'one'), (2, 'two')])) | |
class Test2Schema(colander.MappingSchema): | |
list = colander.SchemaNode(colander.Integer(), | |
widget=deform.widget.SelectWidget(values=[('1', 'one'), ('2', 'two')])) | |
print deform.Form(TestSchema()).render({'list': 1}) | |
print deform.Form(Test2Schema()).render({'list': 1}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment