web/views/editviews.py
branchtls-sprint
changeset 1186 58b4ec2a77f5
parent 1185 ffe1b6f495e8
child 1246 76b3cd5d4f31
equal deleted inserted replaced
1185:ffe1b6f495e8 1186:58b4ec2a77f5
   123         """add options to search among all entities of each possible type"""
   123         """add options to search among all entities of each possible type"""
   124         options = []
   124         options = []
   125         eid = entity.eid
   125         eid = entity.eid
   126         pending_inserts = self.req.get_pending_inserts(eid)
   126         pending_inserts = self.req.get_pending_inserts(eid)
   127         rtype = rschema.type
   127         rtype = rschema.type
   128         for eview, reid in entity.vocabulary(rschema, target, self.limit):
   128         form = self.vreg.select_object('forms', 'edition', self.req,
       
   129                                        entity=entity)
       
   130         field = form.field_by_name(rschema, target)
       
   131         for eview, reid in form.form_field_vocabulary(field, self.limit):
   129             if reid is None:
   132             if reid is None:
   130                 options.append('<option class="separator">-- %s --</option>'
   133                 options.append('<option class="separator">-- %s --</option>'
   131                                % html_escape(eview))
   134                                % html_escape(eview))
   132             else:
   135             else:
   133                 optionid = relation_id(eid, rtype, target, reid)
   136                 optionid = relation_id(eid, rtype, target, reid)