Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Allow the use of Integer values with SelectWidget. Fixes #81.

  • Loading branch information...
commit 494db2b0167711d04a08759e9da88a4a56d12e32 1 parent fe2c7f4
@dnouri dnouri authored
Showing with 13 additions and 7 deletions.
  1. +5 −1 CHANGES.txt
  2. +1 −1  deform/templates/select.pt
  3. +7 −5 deform/widget.py
View
6 CHANGES.txt
@@ -14,7 +14,11 @@ Next release
tjebbes, kiorky
- Allow a custom i18n domain to be used for the "Add ${subitem_title}"
- link of a SequenceWidget. See #85.
+ link of a SequenceWidget. See
+ https://github.com/Pylons/deform/issues/85 .
+
+- Allow the use of Integer values with SelectWidget. See
+ https://github.com/Pylons/deform/issues/81 .
0.9.4 (2012-02-14)
------------------
View
2  deform/templates/select.pt
@@ -3,7 +3,7 @@
tal:attributes="size field.widget.size"
tal:attributes="class field.widget.css_class">
<option tal:repeat="(value, description) field.widget.values"
- tal:attributes="selected value == cstruct and 'selected';
+ tal:attributes="selected str(value) == cstruct and 'selected';
class field.widget.css_class"
value="${value}">${description}</option>
</select>
View
12 deform/widget.py
@@ -613,11 +613,13 @@ class SelectWidget(Widget):
**Attributes/Arguments**
values
- A sequence of two-tuples (both values must be **string** or
- **unicode** values) indicating allowable, displayed values,
- e.g. ``( ('true', 'True'), ('false', 'False') )``. The first
- element in the tuple is the value that should be returned when
- the form is posted. The second is the display value.
+
+ A sequence of two-tuples (the first value must be of type
+ string, unicode or integer, the second value must be string or
+ unicode) indicating allowable, displayed values, e.g. ``(
+ ('true', 'True'), ('false', 'False') )``. The first element
+ in the tuple is the value that should be returned when the
+ form is posted. The second is the display value.
size
The ``size`` attribute of the select input field (default:
Please sign in to comment.
Something went wrong with that request. Please try again.