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.
24 lines
849 B
24 lines
849 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, ExamJ, HomeworkJ, LessonJ
|
|
|
|
for journal in TeacherJ.objects.all():
|
|
if journal.waiting.exists():
|
|
for i in journal.waiting.all():
|
|
j = None
|
|
_type, _map = i.get_next()
|
|
if _type == 'L':
|
|
j = LessonJ.objects.filter(material=_map, student=journal.student)
|
|
elif _type == 'H':
|
|
j = HomeworkJ.objects.filter(material=_map, student=journal.student)
|
|
elif _type == 'E':
|
|
j = ExamJ.objects.filter(material=_map, student=journal.student)
|
|
|
|
if j and j.first().get_status_flag() == 'N':
|
|
journal.waiting.remove(i)
|
|
|