diff --git a/biscuit/apps/untis/api.py b/biscuit/apps/untis/api.py index 313067603011e3d4a493980e98c36c0e60e4c686..767e5b599a9eb51ecf26c683228de34fa714dd7c 100755 --- a/biscuit/apps/untis/api.py +++ b/biscuit/apps/untis/api.py @@ -1,6 +1,7 @@ from django.conf import settings -from untisconnect.api_helper import get_term_by_ids, run_using, untis_date_to_date, date_to_untis_date +from untisconnect.api_helper import get_term_by_ids, run_using, untis_date_to_date, date_to_untis_date, \ + untis_split_first from . import models from timetable.settings import untis_settings @@ -8,8 +9,6 @@ TYPE_TEACHER = 0 TYPE_ROOM = 1 TYPE_CLASS = 2 -from datetime import date - def run_all(obj, filter_term=True): return run_default_filter(run_using(obj).all(), filter_term=filter_term) @@ -118,6 +117,7 @@ class Class(object): self.text1 = None self.text2 = None self.room = None + self.teachers = [] def __str__(self): if self.filled: @@ -138,6 +138,9 @@ class Class(object): self.name = db_obj.name self.text1 = db_obj.longname self.text2 = db_obj.text + teacher_ids = untis_split_first(db_obj.teacherids, int) + self.teachers = [get_teacher_by_id(t_id) for t_id in teacher_ids] + print(self.teachers) # print(db_obj.room_id) if db_obj.room_id != 0: # print("RAUM")