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.
35 lines
1.4 KiB
35 lines
1.4 KiB
# coding=utf-8
|
|
from __future__ import print_function
|
|
from __future__ import print_function
|
|
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 ReportDepth as RD, HomeworkJ as HJ, LessonJ as LJ, ExamJ as EJ
|
|
from courses.models import CourseMap
|
|
for les in LJ.objects.exclude(student=None):
|
|
if les.date:
|
|
print(les)
|
|
RD.objects.get_or_create(token=CourseMap.objects.get(token=les.material.token), student=les.student, course=les.material.course,
|
|
s_date=les.date, f_date=les.f_date)
|
|
|
|
for hw in HJ.objects.exclude(student=None):
|
|
if hw.date:
|
|
print(hw)
|
|
RD.objects.get_or_create(token=CourseMap.objects.get(token=hw.material.token), student=hw.student,
|
|
course=hw.material.course,
|
|
teacher=hw.teacher,
|
|
s_date=hw.date, f_date=hw.f_date)
|
|
|
|
for ex in EJ.objects.exclude(student=None):
|
|
if ex.date:
|
|
print(ex)
|
|
RD.objects.get_or_create(token=CourseMap.objects.get(token=ex.material.token), student=ex.student,
|
|
course=ex.material.course,
|
|
teacher=ex.teacher,
|
|
s_date=ex.date, f_date=ex.f_date)
|
|
|