web/formfields.py
branchtls-sprint
changeset 1562 e6d2c07c0c58
parent 1505 e4c99610e1f7
child 1564 de0548cb0ab8
--- a/web/formfields.py	Wed Apr 29 19:51:10 2009 +0200
+++ b/web/formfields.py	Wed Apr 29 19:52:56 2009 +0200
@@ -94,9 +94,9 @@
         Field.__creation_rank += 1
 
     def __unicode__(self):
-        return u'<%s name=%r label=%r id=%r initial=%r @%x>' % (
+        return u'<%s name=%r label=%r id=%r initial=%r visible=%r @%x>' % (
             self.__class__.__name__, self.name, self.label,
-            self.id, self.initial, id(self))
+            self.id, self.initial, self.is_visible(), id(self))
 
     def __repr__(self):
         return self.__unicode__().encode('utf-8')
@@ -407,7 +407,10 @@
             relatedvocab = [(e.view('combobox'), e.eid) for e in rset.entities()]
         else:
             relatedvocab = []
-        return res + form.form_field_vocabulary(self) + relatedvocab
+        vocab = res + form.form_field_vocabulary(self) + relatedvocab
+        if self.sort:
+            vocab = sorted(vocab)
+        return vocab
 
     def format_single_value(self, req, value):
         return value