Skip to content
Snippets Groups Projects
Commit 135b72f8 authored by Julian's avatar Julian
Browse files

Fix sorting of tables

parent 500c98d6
No related branches found
No related tags found
1 merge request!111Resolve "[Person overview] Implement multiple selection for marking absences as excused or for deleting"
Pipeline #10761 passed
...@@ -94,13 +94,17 @@ class PersonalNoteTable(tables.Table): ...@@ -94,13 +94,17 @@ class PersonalNoteTable(tables.Table):
period = tables.Column( period = tables.Column(
verbose_name=_("Period"), accessor=A("period_formatted"), order_by=A("order_period") verbose_name=_("Period"), accessor=A("period_formatted"), order_by=A("order_period")
) )
groups = tables.Column(verbose_name=_("Groups"), accessor=A("register_object__group_names")) groups = tables.Column(
teachers = tables.Column( verbose_name=_("Groups"),
verbose_name=_("Teachers"), accessor=A("register_object__teacher_names") accessor=A("register_object__group_names"),
order_by=A("order_groups"),
) )
subject = tables.Column( teachers = tables.Column(
verbose_name=_("Subject"), accessor=A("register_object__get_subject__name") verbose_name=_("Teachers"),
accessor=A("register_object__teacher_names"),
order_by=A("order_teachers"),
) )
subject = tables.Column(verbose_name=_("Subject"), accessor=A("subject"))
absent = tables.Column() absent = tables.Column()
late = tables.Column() late = tables.Column()
excused = tables.Column(verbose_name=_("Excuse")) excused = tables.Column(verbose_name=_("Excuse"))
......
...@@ -822,6 +822,16 @@ def overview_person(request: HttpRequest, id_: Optional[int] = None) -> HttpResp ...@@ -822,6 +822,16 @@ def overview_person(request: HttpRequest, id_: Optional[int] = None) -> HttpResp
When(extra_lesson__isnull=False, then="extra_lesson__period__period"), When(extra_lesson__isnull=False, then="extra_lesson__period__period"),
When(lesson_period__isnull=False, then="lesson_period__period__period"), When(lesson_period__isnull=False, then="lesson_period__period__period"),
), ),
order_groups=Case(
When(event__isnull=False, then="event__groups"),
When(extra_lesson__isnull=False, then="extra_lesson__groups"),
When(lesson_period__isnull=False, then="lesson_period__lesson__groups"),
),
order_teachers=Case(
When(event__isnull=False, then="event__teachers"),
When(extra_lesson__isnull=False, then="extra_lesson__teachers"),
When(lesson_period__isnull=False, then="lesson_period__lesson__teachers"),
),
) )
.order_by( .order_by(
"-school_term_start", "-order_year", "-order_week", "-order_weekday", "order_period", "-school_term_start", "-order_year", "-order_week", "-order_weekday", "order_period",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment