update implementation to get vocab from form instead of entity tls-sprint
authorsylvain.thenault@logilab.fr
Tue, 05 May 2009 19:29:43 +0200
branchtls-sprint
changeset 1695 9a9822f3cb6c
parent 1694 d7990e3478b2
child 1696 ee0bea49e0e1
update implementation to get vocab from form instead of entity
web/box.py
--- a/web/box.py	Tue May 05 18:05:24 2009 +0200
+++ b/web/box.py	Tue May 05 19:29:43 2009 +0200
@@ -215,7 +215,10 @@
             return entity.unrelated(self.rtype, self.etype, get_role(self)).entities()
         # in other cases, use vocabulary functions
         entities = []
-        for _, eid in entity.vocabulary(self.rtype, get_role(self)):
+        form = self.vreg.select_object('forms', 'edition', self.req, self.rset,
+                                       row=self.row or 0)
+        field = form.field_by_name(self.rtype, get_role(self), entity.e_schema)
+        for _, eid in form.form_field_vocabulary(field):
             if eid is not None:
                 rset = self.req.eid_rset(eid)
                 entities.append(rset.get_entity(0, 0))