Browse Source

Fixed query.

middleware_test
parent
commit
8ab43b9ae1
  1. 5
      seminar/views.py

5
seminar/views.py

@ -552,9 +552,8 @@ def aktivniResitele(rocnik,cislo):
if int(cislo) > 3:
problemy = Problem.objects.filter(cislo_zadani = letos.cisla)
else:
problemy = Problem.objects.filter(Q(cislo_zadani = letos.cisla)|Q(cislo_zadani=loni.cisla))
resitele = aktualni_resitele.filter(reseni = Reseni.objects.filter(problem=problemy)).distinct()
problemy = Problem.objects.filter(Q(cislo_zadani__in = letos.cisla)|Q(cislo_zadani__in = loni.cisla))
resitele = aktualni_resitele.filter(reseni__in = Reseni.objects.filter(problem__in=problemy)).distinct()
return resitele

Loading…
Cancel
Save