web/formfields.py
changeset 5955 67dfe437bf25
parent 5916 36206e846a27
child 6082 57933567146f
child 6114 3e1718a2db55
equal deleted inserted replaced
5953:af48c527aea7 5955:67dfe437bf25
   409                      for label, value in vocab]
   409                      for label, value in vocab]
   410         if self.sort:
   410         if self.sort:
   411             vocab = vocab_sort(vocab)
   411             vocab = vocab_sort(vocab)
   412         # XXX pre 3.9 bw compat
   412         # XXX pre 3.9 bw compat
   413         for i, (label, value) in enumerate(vocab):
   413         for i, (label, value) in enumerate(vocab):
   414             if not isinstance(value, basestring):
   414             if value is not None and not isinstance(value, basestring):
   415                 warn('[3.9] %s: vocabulary value should be an unicode string'
   415                 warn('[3.9] %s: vocabulary value should be an unicode string'
   416                      % self, DeprecationWarning)
   416                      % self, DeprecationWarning)
   417                 vocab[i] = (label, unicode(value))
   417                 vocab[i] = (label, unicode(value))
   418         return vocab
   418         return vocab
   419 
   419