From 4763591fced4dd2d0b082000f5fe9a5b8b923254 Mon Sep 17 00:00:00 2001 From: stitch1 Date: Thu, 7 Nov 2024 18:26:55 +0100 Subject: [PATCH] document why a certain output order is not used --- src/ctlssa/suggestions/logic/suggest.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/ctlssa/suggestions/logic/suggest.py b/src/ctlssa/suggestions/logic/suggest.py index 56cb3f7..0b847d6 100644 --- a/src/ctlssa/suggestions/logic/suggest.py +++ b/src/ctlssa/suggestions/logic/suggest.py @@ -45,4 +45,14 @@ def suggest_subdomains(domain: str, suffix: str = "nl", period_in_days: int = 36 last_seen__gte=some_time_ago, ).values_list("subdomain", flat=True) + # use reverse string sorting to get subdomains in the correct order: + # a.amsterdam.basis.nl + # b.amsterdam.basis.nl + # a.zutphen.basis.nl + # this is very hard to understand for normal users, this might be sorting option in the UI but should not be + # the default. + # domains = set(query) + # sorted_data = [domain[::-1] for domain in domains] + # sorted_data.sort() + # [domain[::-1] for domain in sorted_data] return sorted(set(query))