web/formfields.py
changeset 6225 a176e68b7d0d
parent 6142 8bc6eac1fac1
parent 6218 d37428222a63
child 6333 e3994fcc21c3
--- a/web/formfields.py	Tue Sep 07 17:34:42 2010 +0200
+++ b/web/formfields.py	Mon Sep 13 15:15:21 2010 +0200
@@ -416,11 +416,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):