You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
889 B
26 lines
889 B
# coding=utf-8
|
|
import os
|
|
import django
|
|
import sys
|
|
|
|
sys.path.append("/var/www/projects/lms/")
|
|
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "lms.settings")
|
|
django.setup()
|
|
from journals.models import TeacherJ, CourseThemeJ, LessonJ, ExamJ, HomeworkJ
|
|
|
|
for i in TeacherJ.objects.all():
|
|
if i.waiting.exists():
|
|
for n in i.waiting.all():
|
|
obj = n.get_obj()
|
|
if n._type == 'L':
|
|
mj = LessonJ.objects.get(material=obj, student=i.student)
|
|
|
|
elif n._type == 'H':
|
|
mj = HomeworkJ.objects.get(material=obj, student=i.student)
|
|
|
|
elif n._type == 'E':
|
|
mj = ExamJ.objects.get(material=obj, student=i.student)
|
|
|
|
cj = CourseThemeJ.objects.get(student=i.student, material=obj.theme)
|
|
if cj.get_status_flag() == 'N' or mj.get_status_flag() != 'N':
|
|
i.waiting.remove(n)
|
|
|