fix sorting of relations when order is (in part) set manually

This commit is contained in:
Helmut Merz 2025-05-12 22:19:58 +02:00
parent 6a0a0841a1
commit 8661a653d6

View file

@ -182,7 +182,7 @@ class Concept(Contained, Persistent):
predicates = predicates is None and ['c*'] or predicates
relationships = [ConceptRelation(self, None, p) for p in predicates]
if sort == 'default':
sort = lambda x: (x.order or '',
sort = lambda x: (x.order or 0,
(x.second.title and x.second.title.lower() or ''))
rels = (r for r in getRelations(self, child, relationships=relationships,
usePredicateIndex=usePredicateIndex)