Skip to content
Snippets Groups Projects
Commit 305fc198 authored by Julian's avatar Julian
Browse files

Add field person to StatisticsByPersonType

parent ddd6c62d
No related branches found
No related tags found
1 merge request!361Resolve "Add statistics page for absences"
......@@ -34,6 +34,7 @@ class ExtraMarkWithCountType(graphene.ObjectType):
class StatisticsByPersonType(graphene.ObjectType):
person = graphene.Field(PersonType)
participation_count = graphene.Int()
absence_count = graphene.Int()
absence_reasons = graphene.List(AbsenceReasonWithCountType)
......@@ -41,6 +42,10 @@ class StatisticsByPersonType(graphene.ObjectType):
tardiness_count = graphene.Int()
extra_marks = graphene.List(ExtraMarkWithCountType)
@staticmethod
def resolve_person(root: Person, info):
return root
def resolve_absence_reasons(root, info):
return [
dict(absence_reason=reason, count=getattr(root, reason.count_label))
......
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