web/formfields.py
branchstable
changeset 6218 d37428222a63
parent 6114 3e1718a2db55
child 6225 a176e68b7d0d
child 6285 b8a2c9b9a2cb
--- a/web/formfields.py	Mon Sep 13 11:00:22 2010 +0200
+++ b/web/formfields.py	Mon Sep 13 12:24:11 2010 +0200
@@ -410,11 +410,16 @@
         if self.sort:
             vocab = vocab_sort(vocab)
         # XXX pre 3.9 bw compat
-        for i, (label, value) in enumerate(vocab):
+        for i, option in enumerate(vocab):
+            # option may be a 2 or 3-uple (see Select widget _render method for
+            # explanation)
+            value = option[1]
             if value is not None and not isinstance(value, basestring):
                 warn('[3.9] %s: vocabulary value should be an unicode string'
                      % self, DeprecationWarning)
-                vocab[i] = (label, unicode(value))
+                option = list(option)
+                option[1] = unicode(value)
+                vocab[i] = option
         return vocab
 
     def format(self, form):