|
|
@ -218,10 +218,11 @@ class DetailReseniView(DetailView): |
|
|
|
self.reseni = get_object_or_404(m.Reseni, id=self.kwargs['pk']) |
|
|
|
result = [] # Slovníky s klíči problem, body, deadline_body -- initial data pro f.OhodnoceniReseniFormSet |
|
|
|
for hodn in m.Hodnoceni.objects.filter(reseni=self.reseni): |
|
|
|
result.append( |
|
|
|
{"problem": hodn.problem, |
|
|
|
result.append({ |
|
|
|
"problem": hodn.problem, |
|
|
|
"body": hodn.body, |
|
|
|
"deadline_body": hodn.deadline_body, |
|
|
|
"feedback": hodn.feedback, |
|
|
|
}) |
|
|
|
return result |
|
|
|
|
|
|
@ -261,10 +262,12 @@ def hodnoceniReseniView(request, pk, *args, **kwargs): |
|
|
|
problem = form.cleaned_data['problem'] |
|
|
|
body = form.cleaned_data['body'] |
|
|
|
deadline_body = form.cleaned_data['deadline_body'] |
|
|
|
feedback = form.cleaned_data['feedback'] |
|
|
|
hodnoceni = m.Hodnoceni( |
|
|
|
problem=problem, |
|
|
|
body=body, |
|
|
|
deadline_body=deadline_body, |
|
|
|
feedback=feedback, |
|
|
|
reseni=reseni, |
|
|
|
) |
|
|
|
logger.info(f"Creating Hodnoceni: {hodnoceni}") |
|
|
@ -285,6 +288,7 @@ class ResitelReseniView(DetailView): |
|
|
|
{ |
|
|
|
"problem": hodn.problem, |
|
|
|
"body": hodn.body, |
|
|
|
"feedback": hodn.feedback, |
|
|
|
# "deadline_body": hodn.deadline_body, |
|
|
|
} |
|
|
|
) |
|
|
|