parent
3f34a82a48
commit
fea8544fcd
2 changed files with 40 additions and 0 deletions
@ -0,0 +1,37 @@ |
|||||||
|
# coding=utf-8 |
||||||
|
# Получить почты пользователей с темой в статусе сдано |
||||||
|
import os |
||||||
|
import django |
||||||
|
import sys |
||||||
|
BASEDIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) |
||||||
|
|
||||||
|
sys.path.append("/var/www/projects/codemy/") |
||||||
|
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "lms.settings") |
||||||
|
django.setup() |
||||||
|
|
||||||
|
from courses.models import Course, CourseTheme |
||||||
|
from journals.models import CourseThemeJ |
||||||
|
|
||||||
|
print('## Почты пользователей в статусе сдано по теме') |
||||||
|
|
||||||
|
_courses = Course.objects.filter(public=True).order_by('id') |
||||||
|
|
||||||
|
for _c in _courses: |
||||||
|
print('{0}: {1}'.format(_c.id, _c.get_title())) |
||||||
|
|
||||||
|
_c = input('Выберите курс: ') |
||||||
|
_course = Course.objects.get(id=int(_c)) |
||||||
|
|
||||||
|
_themes = CourseTheme.objects.filter(course=_course).order_by('sort') |
||||||
|
for _t in _themes: |
||||||
|
print('{0}: {2}/{1}'.format(_t.id, _t.get_title(), _t.sort)) |
||||||
|
|
||||||
|
_t = input('Выберите тему: ') |
||||||
|
_theme = CourseTheme.objects.get(id=int(_t)) |
||||||
|
|
||||||
|
_result = CourseThemeJ.objects.filter(material=_theme).exclude(date=None, f_date=None).values_list('student__email', flat=True) |
||||||
|
|
||||||
|
for i in _result: |
||||||
|
print(i) |
||||||
|
|
||||||
|
print('Количество пользователей: {0}'.format(len(_result))) |
||||||
Loading…
Reference in new issue