From 8661a653d66ffe3a68177fb018a99a4424308cb2 Mon Sep 17 00:00:00 2001 From: Helmut Merz Date: Mon, 12 May 2025 22:19:58 +0200 Subject: [PATCH] fix sorting of relations when order is (in part) set manually --- loops/concept.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/loops/concept.py b/loops/concept.py index bae121d..8aa335a 100644 --- a/loops/concept.py +++ b/loops/concept.py @@ -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)