equal
deleted
inserted
replaced
402 # weird strings display) |
402 # weird strings display) |
403 vocab = [(label and form._cw._(label), value) |
403 vocab = [(label and form._cw._(label), value) |
404 for label, value in vocab] |
404 for label, value in vocab] |
405 if self.sort: |
405 if self.sort: |
406 vocab = vocab_sort(vocab) |
406 vocab = vocab_sort(vocab) |
407 # XXX pre 3.9 bw compat |
|
408 for i, option in enumerate(vocab): |
|
409 # option may be a 2 or 3-uple (see Select widget _render method for |
|
410 # explanation) |
|
411 value = option[1] |
|
412 if value is not None and not isinstance(value, basestring): |
|
413 warn('[3.9] %s: vocabulary value should be an unicode string' |
|
414 % self, DeprecationWarning) |
|
415 option = list(option) |
|
416 option[1] = unicode(value) |
|
417 vocab[i] = option |
|
418 return vocab |
407 return vocab |
419 |
408 |
420 # support field as argument to avoid warning when used as format field value |
409 # support field as argument to avoid warning when used as format field value |
421 # callback |
410 # callback |
422 def format(self, form, field=None): |
411 def format(self, form, field=None): |