Browse Source

Fix autocomplete (deadline -> zadani)

middleware_test
Jonas Havelka 3 years ago
parent
commit
0c176b8a91
  1. 2
      seminar/views/autocomplete.py

2
seminar/views/autocomplete.py

@ -35,7 +35,7 @@ class OdevzdatelnyProblemAutocomplete(autocomplete.Select2QuerySetView):
rocnik = nastaveni.aktualni_rocnik
# Od tohoto místa dál jsem zkoušel spoustu variací podle https://django-polymorphic.readthedocs.io/en/stable/advanced.html
temaQ = Q(Tema___rocnik = rocnik, stav=m.Problem.STAV_ZADANY)
ulohaQ = Q(Uloha___cislo_deadline__rocnik = rocnik, stav=m.Problem.STAV_ZADANY)
ulohaQ = Q(Uloha___cislo_zadani__rocnik = rocnik, stav=m.Problem.STAV_ZADANY)
clanekQ = Q(Clanek___cislo__rocnik = rocnik, stav=m.Problem.STAV_ZADANY)
qs = m.Problem.objects.filter(temaQ | ulohaQ | clanekQ)
#print(temata, ulohy, clanky)

Loading…
Cancel
Save