mirror of
https://github.com/evgen-app/evg-app-back.git
synced 2024-11-22 08:46:34 +03:00
27 lines
824 B
Python
27 lines
824 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.objects.create(type_lesson=classLocal)
|
|
|
|
def addTestToLesson(lesson, deadline, name):
|
|
Tests.objects.create(name=name, deadline=deadline, lesson=lesson)
|
|
|
|
def addTaskToTest(test, theory, practise, mark):
|
|
Task.objects.create(theory=theory, practise=practise, test=test, number=mark) |