Skip to content
Snippets Groups Projects

WIP: Add way to edit substitution

Merged Tom Teichler requested to merge issue12 into master
Files
5
@@ -4,7 +4,7 @@ from django.utils.translation import ugettext_lazy as _
from biscuit.core.models import Person, Group
from .models import Room, LessonSubstitution
from .models import Room, LessonSubstitution, Subject, LessonPeriod
class SelectForm(forms.Form):
@@ -25,7 +25,11 @@ class LessonSubstitutionForm(forms.ModelForm):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.fields['lesson_period'].queryset = LessonPeriod.objects.all()
self.fields['subject'].queryset = Subject.objects.all()
self.fields['teachers'].queryset = Person.objects.all()
self.fields['room'].queryset = Room.objects.all()
self.fields['week'].disabled = True
self.fields['lesson_period'].disabled = True
Loading