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.
 
 
 
 
 
 

18 lines
774 B

# coding=utf-8
from lms.decors import api_decor
# Получить
@api_decor(without_auth=False, need_keys=['theme', 'student'], method='POST', check_request=True)
def load_homework_comments_for_teacher(request, context):
# Получение комментариев для преподавателя
homework = HomeworkJ.objects.get(material__theme__id=request.POST['theme'], student__id=request.POST['student'],
teacher=request.user)
context['data'] = []
for i in homework.comments.filter(parent_id='0').order_by('date'):
context['data'].append(comment_fabric(i, __user=request.user))
if len(context['data']) == 0:
context['code'] = '0'
else:
context['code'] = '1'
return context