--- a/entity.py Tue Mar 10 15:18:04 2009 +0100
+++ b/entity.py Tue Mar 10 15:39:23 2009 +0100
@@ -802,7 +802,7 @@
from logilab.common.testlib import mock_object
form = EntityFieldsForm(self.req, entity=self)
field = mock_object(name=rtype, role=role)
- return form.form_field_vocabulary(field)
+ return form.form_field_vocabulary(field, limit)
def unrelated_rql(self, rtype, targettype, role, ordermethod=None,
vocabconstraints=True):
--- 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)