|
|
@ -73,10 +73,27 @@ class ReseniProblemuView(ListView): |
|
|
|
|
|
|
|
def get_queryset(self): |
|
|
|
qs = super().get_queryset() |
|
|
|
resitel_id = self.kwargs['resitel'] |
|
|
|
if resitel_id is None: |
|
|
|
raise ValueError("Nemám řešitele!") |
|
|
|
problem_id = self.kwargs['problem'] |
|
|
|
if problem_id is None: |
|
|
|
raise ValueError("Nemám problém! (To je problém!)") |
|
|
|
|
|
|
|
resitel = m.Resitel.objects.get(id=resitel_id) |
|
|
|
problem = m.Resitel.objects.get(id=problem_id) |
|
|
|
qs = qs.filter( |
|
|
|
problem__in=[problem], |
|
|
|
resitele__in=[resitel], |
|
|
|
) |
|
|
|
return qs |
|
|
|
|
|
|
|
# Kontext automaticky? |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class DetailReseniView(DetailView): |
|
|
|
model = m.Reseni |
|
|
|
template_name = 'TODO' |
|
|
|
# To je všechno? Najde se to bude slugem... |
|
|
|
|
|
|
|
# Přehled všech řešení kvůli debugování |
|
|
|
|
|
|
|