From 3b152a8a7f2cdcd01d93a5af2c3fe09d43bf15f1 Mon Sep 17 00:00:00 2001 From: Michael Bauer <michael-bauer@posteo.de> Date: Thu, 2 May 2024 17:31:42 +0200 Subject: [PATCH] Add LessonsForPersonType --- aleksis/apps/alsijil/schema/__init__.py | 2 +- aleksis/apps/alsijil/schema/absences.py | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/aleksis/apps/alsijil/schema/__init__.py b/aleksis/apps/alsijil/schema/__init__.py index fd813944b..7803b6127 100644 --- a/aleksis/apps/alsijil/schema/__init__.py +++ b/aleksis/apps/alsijil/schema/__init__.py @@ -38,7 +38,7 @@ class Query(graphene.ObjectType): courses_of_person = FilterOrderList(CourseType, person=graphene.ID()) lessons_for_persons = FilterOrderList( - LessonForPerson, # person graphene.List(LessonEvent) + LessonsForPersonType, persons=graphene.List(graphene.ID, required=True), start=graphene.Date(required=True), end=graphene.Date(required=True), diff --git a/aleksis/apps/alsijil/schema/absences.py b/aleksis/apps/alsijil/schema/absences.py index 323ceb192..00304a581 100644 --- a/aleksis/apps/alsijil/schema/absences.py +++ b/aleksis/apps/alsijil/schema/absences.py @@ -1,4 +1,9 @@ import graphene +from aleksis.apps.chronos.schema import LessonEventType + +class LessonsForPersonType(graphene.ObjectType): + id = graphene.ID() # noqa + lessons = graphene.List(LessonEventType) class AbsencesBatchCreateMutation(graphene.Mutation): class Arguments: -- GitLab