web/form.py
branchtls-sprint
changeset 1031 1a89683cb687
parent 1016 26387b836099
child 1032 25ec009daa95
--- a/web/form.py	Tue Mar 10 15:18:04 2009 +0100
+++ b/web/form.py	Tue Mar 10 15:39:23 2009 +0100
@@ -923,7 +923,7 @@
             return eid_param(field.id, self.entity.eid)
         return field.id
         
-    def form_field_vocabulary(self, field):
+    def form_field_vocabulary(self, field, limit=None):
         role, rtype = field.role, field.name
         try:
             vocabfunc = getattr(self.entity, '%s_%s_vocabulary' % (role, rtype))
@@ -938,7 +938,7 @@
         #       important because `vocabfunc` might return a list with
         #       couples (label, None) which act as separators. In these
         #       cases, it doesn't make sense to sort results afterwards.
-        return vocabfunc(rtype)
+        return vocabfunc(rtype, limit)
 ## XXX BACKPORT ME
 ##         if self.sort:
 ##             choices = sorted(choices)