Skip to content
Snippets Groups Projects
Verified Commit 804350a6 authored by Nik | Klampfradler's avatar Nik | Klampfradler
Browse files

Add model extensions for a person's lesson periods.

parent 30b46ee5
No related branches found
No related tags found
No related merge requests found
from biscuit.core.models import Person from biscuit.core.models import Person
from .models import Lesson from .models import Lesson, LessonPeriod
@Person.property @Person.property
def lessons_as_participant(self): def lessons_as_participant(self):
return Lesson.objects.filter(groups__members=self) return Lesson.objects.filter(groups__members=self)
@Person.property
def lesson_periods_as_participant(self):
return LessonPeriod.objects.filter(lesson__groups__members=self)
@Person.property
def lesson_periods_as_teacher(self):
return LessonPeriod.objects.filter(lesson__teachers=self)
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