Commits

Christoph Haas committed c53b1ef

Fix: now sets correct option to "selected" with select() on numeric values

  • Participants
  • Parent commits 49c0161

Comments (0)

Files changed (1)

webhelpers/html/tags.py

         selected_values = (selected_values,)
     opts = []
     # Cast integer values to strings
-    selected_values = map(str, selected_values)
+    selected_values = map(unicode, selected_values)
     for option in options:
         if isinstance(option, basestring):
             label = value = option
         else:
-            label = option[0]
-            value = option[1]
+            label = unicode(option[0])
+            value = unicode(option[1])
         if value in selected_values:
             opt = HTML.option(label, value=value, selected="selected")
         else: