diff options
Diffstat (limited to 'pyblackbird_cc/resources/forms.py')
-rw-r--r-- | pyblackbird_cc/resources/forms.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/pyblackbird_cc/resources/forms.py b/pyblackbird_cc/resources/forms.py index e905944..be90a00 100644 --- a/pyblackbird_cc/resources/forms.py +++ b/pyblackbird_cc/resources/forms.py @@ -20,6 +20,7 @@ ALLOWED_PDFS = 20 def _create_choices_tuple() -> List[Tuple[str, str]]: qs_lst = list(ResourceSubcategory.objects.values_list('name', flat=True)) + qs_lst.sort() res = [] for x in qs_lst: res.append((x, x)) @@ -31,7 +32,7 @@ class ResourceCreateForm(forms.Form): super().__init__(*args, **kwargs) self.helper = FormHelper(self) self.helper.add_input(Submit("submit", "Submit")) - self.fields['additional_resource_category'].choices = _create_choices_tuple() + self.fields['subcategories'].choices = _create_choices_tuple() error_css_class = "error" required_css_class = "required" @@ -84,7 +85,7 @@ class ResourceCreateForm(forms.Form): "searches. It's a good idea to limit the number of subjects you select " "to one or two to make your resource easier to find.", ) - additional_resource_category = forms.MultipleChoiceField( + subcategories = forms.MultipleChoiceField( required=False, ) @@ -174,6 +175,6 @@ class ResourceUpdateMetadataForm(forms.ModelForm): "age_range", "curriculum", "main_resource_category", - "additional_resource_category", + "subcategories", "feature_slot", ] |