evg-app-back/lessons/db_functions.py
2021-01-10 15:51:59 +03:00

21 lines
541 B
Python

from .models import Subject, SubjectClassLocal
from organisations.models import Organisation
def extendOrganisationSubject(org, sub_name):
Subject.objects.create(name=sub_name, organisation=org)
def addSubjectToGroup(group, subName, subject):
SubjectClassLocal.objects.create(name=subName, subject=subject, group=group)
def addClassToTeacher(classLocal, teacher):
classLocal.teachers.add(teacher)
def removeTeacherFromClass(classLocal, teacher):
classLocal.teachers.remove(teacher)
def addLessonToClass(classLocal):
Lesson