Browse Source

Lepší "Moje problémy"

middleware_test
Pavel "LEdoian" Turinsky 3 years ago
parent
commit
8e47df2865
  1. 22
      seminar/views/views_all.py

22
seminar/views/views_all.py

@ -846,17 +846,17 @@ class OrgoRozcestnikView(TemplateView):
u = self.request.user
os = s.Osoba.objects.get(user=u)
organizator = s.Organizator.objects.get(osoba=os)
temata_garant = s.Tema.objects.filter(garant=organizator,
rocnik=aktualni_rocnik)
#FIXME: přidat opravovatel, stav='STAV_ZADANY'
ulohy_garant = s.Uloha.objects.filter(garant=organizator,
cislo_zadani__rocnik=aktualni_rocnik)
clanky_garant = s.Clanek.objects.filter(garant=organizator,
cislo__rocnik=aktualni_rocnik)
context['temata'] = temata_garant
context['ulohy'] = ulohy_garant
context['clanky'] = clanky_garant
#FIXME: přidat stav='STAV_ZADANY'
temata = s.Tema.objects.filter(Q(garant=organizator) | Q(autor=organizator) | Q(opravovatele__in=[organizator]),
rocnik=aktualni_rocnik).distinct()
ulohy = s.Uloha.objects.filter(Q(garant=organizator) | Q(autor=organizator) | Q(opravovatele__in=[organizator]),
cislo_zadani__rocnik=aktualni_rocnik).distinct()
clanky = s.Clanek.objects.filter(Q(garant=organizator) | Q(autor=organizator) | Q(opravovatele__in=[organizator]),
cislo__rocnik=aktualni_rocnik).distinct()
context['temata'] = temata
context['ulohy'] = ulohy
context['clanky'] = clanky
context['organizator'] = organizator
return context

Loading…
Cancel
Save