public
Created

Using Integer type with SelectWidget renders wrong selected values

  • Download Gist
test.py
Python
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
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})

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.