From dd4fd5f4575fb68b584c4131a04a74a11e2902a5 Mon Sep 17 00:00:00 2001 From: Matthew Lemon Date: Thu, 1 Aug 2024 16:21:39 +0100 Subject: Ordering the subcategories dropdown list on the update form. --- pyblackbird_cc/resources/forms.py | 1 + 1 file changed, 1 insertion(+) (limited to 'pyblackbird_cc/resources/forms.py') diff --git a/pyblackbird_cc/resources/forms.py b/pyblackbird_cc/resources/forms.py index be90a00..41ad3c8 100644 --- a/pyblackbird_cc/resources/forms.py +++ b/pyblackbird_cc/resources/forms.py @@ -161,6 +161,7 @@ class ResourceUpdateMetadataForm(forms.ModelForm): super().__init__(*args, **kwargs) self.helper = FormHelper(self) self.helper.add_input(Submit("submit", "Submit")) + self.fields['subcategories'].queryset = ResourceSubcategory.objects.all().order_by('name') error_css_class = "error" required_css_class = "required" -- cgit v1.2.3