From 6f73dfb263ce9c0a2bc8a76886ab762b48cf3c97 Mon Sep 17 00:00:00 2001 From: Jonathan Weth <git@jonathanweth.de> Date: Thu, 18 Mar 2021 10:18:22 +0100 Subject: [PATCH] Add missing doc strings for forms and helpers --- aleksis/apps/alsijil/forms.py | 4 ++++ aleksis/apps/alsijil/preferences.py | 2 ++ aleksis/apps/alsijil/util/alsijil_helpers.py | 1 + 3 files changed, 7 insertions(+) diff --git a/aleksis/apps/alsijil/forms.py b/aleksis/apps/alsijil/forms.py index 1f912fc2f..72d3d2027 100644 --- a/aleksis/apps/alsijil/forms.py +++ b/aleksis/apps/alsijil/forms.py @@ -262,6 +262,8 @@ class GroupRoleAssignmentEditForm(forms.ModelForm): class FilterRegisterObjectForm(forms.Form): + """Form for filtering register objects in ``RegisterObjectTable``.""" + layout = Layout( Row("school_term", "date_start", "date_end"), Row("has_documentation", "group", "subject") ) @@ -317,4 +319,6 @@ class FilterRegisterObjectForm(forms.Form): class RegisterObjectActionForm(ListActionForm): + """Action form for managing register objects for use with ``RegisterObjectTable``.""" + actions = [send_request_to_check_entry] diff --git a/aleksis/apps/alsijil/preferences.py b/aleksis/apps/alsijil/preferences.py index d9d357b8a..3ad751865 100644 --- a/aleksis/apps/alsijil/preferences.py +++ b/aleksis/apps/alsijil/preferences.py @@ -114,6 +114,8 @@ class ShowGroupRolesInLessonView(BooleanPreference): @person_preferences_registry.register class RegisterObjectsTableItemsPerPage(IntegerPreference): + """Preference how many items are shown per page in ``RegisterObjectTable``.""" + section = alsijil name = "register_objects_table_items_per_page" default = 100 diff --git a/aleksis/apps/alsijil/util/alsijil_helpers.py b/aleksis/apps/alsijil/util/alsijil_helpers.py index bf51d47ec..b5879b1f2 100644 --- a/aleksis/apps/alsijil/util/alsijil_helpers.py +++ b/aleksis/apps/alsijil/util/alsijil_helpers.py @@ -111,6 +111,7 @@ def _filter_register_objects_by_dict( register_objects: QuerySet[Union[LessonPeriod, Event, ExtraLesson]], label_: str, ) -> QuerySet[Union[LessonPeriod, Event, ExtraLesson]]: + """Filter register objects by a dictionary generated through ``FilterRegisterObjectForm``.""" if label_ == LessonPeriod.label_: register_objects = register_objects.filter( lesson__validity__school_term=filter_dict.get("school_term") -- GitLab