Commits

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.

  • Participants
  • Parent commits f8570c6

Comments (0)

Files changed (1)

File MoinMoin/forms.py

         return cls
 
     @classmethod
-    def _get_choices(cls):
+    def _get_choice_specs(cls):
         revs = flaskg.storage.search(cls._query, **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()
-        self.properties['labels'] = dict(choices)
-        self.valid_values = [id_ for id_, name in choices]
+        choice_specs = self._get_choice_specs()
+        self.properties['choice_specs'] = choice_specs
+        self.valid_values = [id_ for id_, name in choice_specs]
 
 
 class BackReference(ReadonlyItemLinkList):