equal
deleted
inserted
replaced
248 def tree(self): |
248 def tree(self): |
249 thesaurus = get_parent(self.context, IThesaurus) |
249 thesaurus = get_parent(self.context, IThesaurus) |
250 extract = self.context.name |
250 extract = self.context.name |
251 return sorted((INode(node) for node in ITree(thesaurus).get_root_nodes() |
251 return sorted((INode(node) for node in ITree(thesaurus).get_root_nodes() |
252 if extract in (node.extracts or ())), |
252 if extract in (node.extracts or ())), |
253 key=lambda x: x.label) |
253 key=lambda x: (x.order or 999, x.label)) |
254 |
254 |
255 |
255 |
256 class BaseTreeNodesView(object): |
256 class BaseTreeNodesView(object): |
257 """Base tree nodes views""" |
257 """Base tree nodes views""" |
258 |
258 |
289 raise NotFound |
289 raise NotFound |
290 result = [] |
290 result = [] |
291 self.get_nodes(term, result) |
291 self.get_nodes(term, result) |
292 return { |
292 return { |
293 'term': label, |
293 'term': label, |
294 'nodes': sorted(result, key=lambda x: x['label']) |
294 'nodes': result |
295 } |
295 } |