src/pyams_thesaurus/zmi/widget/__init__.py
changeset 87 dfe19304d980
parent 78 8bab1101f4ef
child 121 b801eda057ff
equal deleted inserted replaced
86:04f176e237cc 87:dfe19304d980
   179     @property
   179     @property
   180     def top_terms(self):
   180     def top_terms(self):
   181         thesaurus = query_utility(IThesaurus, name=self.thesaurus_name or '')
   181         thesaurus = query_utility(IThesaurus, name=self.thesaurus_name or '')
   182         if thesaurus is not None:
   182         if thesaurus is not None:
   183             return sorted(thesaurus.get_top_terms(extract=self.extract_name),
   183             return sorted(thesaurus.get_top_terms(extract=self.extract_name),
   184                           key=lambda x: x.label)
   184                           key=lambda x: (x.order or 999, x.label))
   185         else:
   185         else:
   186             return ()
   186             return ()
   187 
   187 
   188     def get_subterms(self, term):
   188     def get_subterms(self, term):
   189         for subterm in term.specifics:
   189         for subterm in term.specifics: