838 else: # if role == 'object': |
838 else: # if role == 'object': |
839 for entity in getattr(self, 'reverse_%s' % rschema.type): |
839 for entity in getattr(self, 'reverse_%s' % rschema.type): |
840 words += entity.get_words() |
840 words += entity.get_words() |
841 return words |
841 return words |
842 |
842 |
843 @deprecated('[3.2] see new form api') |
|
844 def vocabulary(self, rtype, role='subject', limit=None): |
|
845 """vocabulary functions must return a list of couples |
|
846 (label, eid) that will typically be used to fill the |
|
847 edition view's combobox. |
|
848 |
|
849 If `eid` is None in one of these couples, it should be |
|
850 interpreted as a separator in case vocabulary results are grouped |
|
851 """ |
|
852 from logilab.common.testlib import mock_object |
|
853 form = self.vreg.select('forms', 'edition', self.req, entity=self) |
|
854 field = mock_object(name=rtype, role=role) |
|
855 return form.form_field_vocabulary(field, limit) |
|
856 |
|
857 |
843 |
858 # attribute and relation descriptors ########################################## |
844 # attribute and relation descriptors ########################################## |
859 |
845 |
860 class Attribute(object): |
846 class Attribute(object): |
861 """descriptor that controls schema attribute access""" |
847 """descriptor that controls schema attribute access""" |