xiaq committed be05c7f

Fix Reference element.

The 'select' widget used by Reference now uses the 'choice_specs' property
instead of 'valid_values' member and 'labels' property.

Comments (0)

Files changed (1)


         return cls
-    def _get_choices(cls):
+    def _get_choice_specs(cls):
         revs =, **cls._query_args)
         choices = [(rev.meta[ITEMID], rev.meta[NAME]) for rev in revs]
         if cls.optional:
         # NOTE There is a slight chance of two instances of the same Reference
         # subclass having different set of choices when the storage changes
         # between their initialization.
-        choices = self._get_choices()
-['labels'] = dict(choices)
-        self.valid_values = [id_ for id_, name in choices]
+        choice_specs = self._get_choice_specs()
+['choice_specs'] = choice_specs
+        self.valid_values = [id_ for id_, name in choice_specs]
 class BackReference(ReadonlyItemLinkList):