From 6c12030bc8740442479e0943ad9d3f731c4f97c4 Mon Sep 17 00:00:00 2001 From: M Somerville Date: Sun, 1 Dec 2024 15:28:20 +0000 Subject: [PATCH 1/2] Set default ordering of PCNs This is so that on a page such as https://openprescribing.net/sicbl/15E/ the PCN list is shown in alphabetical order. --- openprescribing/frontend/models.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/openprescribing/frontend/models.py b/openprescribing/frontend/models.py index 421bc49acf..7999e5ffe3 100644 --- a/openprescribing/frontend/models.py +++ b/openprescribing/frontend/models.py @@ -129,6 +129,9 @@ class PCN(models.Model): HUMAN_NAME = "PCN" + class Meta: + ordering = ['name'] + def __str__(self): return self.name From 978a09168305d11443477e7e954327b3899cd22f Mon Sep 17 00:00:00 2001 From: M Somerville Date: Mon, 2 Dec 2024 09:50:32 +0000 Subject: [PATCH 2/2] fixup previous commit --- openprescribing/frontend/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openprescribing/frontend/models.py b/openprescribing/frontend/models.py index 7999e5ffe3..0534a44f3a 100644 --- a/openprescribing/frontend/models.py +++ b/openprescribing/frontend/models.py @@ -130,7 +130,7 @@ class PCN(models.Model): HUMAN_NAME = "PCN" class Meta: - ordering = ['name'] + ordering = ["name"] def __str__(self): return self.name