Tabulka odevzdaných řešení: filtr podle neobodovaných
This commit is contained in:
parent
fcfabb1bf4
commit
303b6bab4a
3 changed files with 7 additions and 0 deletions
|
@ -404,6 +404,7 @@ class OdevzdavatkoTabulkaFiltrForm(forms.Form):
|
|||
'problemy': cls.PROBLEMY_MOJE,
|
||||
'reseni_od': terminy[-2],
|
||||
'reseni_do': terminy[-1],
|
||||
'neobodovane': False,
|
||||
}
|
||||
return initial
|
||||
|
||||
|
@ -426,3 +427,4 @@ class OdevzdavatkoTabulkaFiltrForm(forms.Form):
|
|||
|
||||
reseni_od = forms.DateField(input_formats=[DATE_FORMAT])
|
||||
reseni_do = forms.DateField(input_formats=[DATE_FORMAT])
|
||||
neobodovane = forms.BooleanField(required=False)
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
{{ filtr.problemy }}
|
||||
Od: {{ filtr.reseni_od }}
|
||||
Do: {{ filtr.reseni_do }}
|
||||
<span title="Jen neobodovaná řešení">🔨?</span> {{ filtr.neobodovane }}
|
||||
<input type=submit value="→">
|
||||
</form>
|
||||
|
||||
|
|
|
@ -59,12 +59,14 @@ class TabulkaOdevzdanychReseniView(ListView):
|
|||
problemy = fcd["problemy"]
|
||||
reseni_od = fcd["reseni_od"]
|
||||
reseni_do = fcd["reseni_do"]
|
||||
jen_neobodovane = fcd["neobodovane"]
|
||||
else:
|
||||
initial = FiltrForm.gen_initial()
|
||||
resitele = initial['resitele']
|
||||
problemy = initial['problemy']
|
||||
reseni_od = initial['reseni_od'][0]
|
||||
reseni_do = initial['reseni_do'][0]
|
||||
jen_neobodovane = initial["neobodovane"]
|
||||
|
||||
|
||||
# Filtrujeme!
|
||||
|
@ -87,6 +89,8 @@ class TabulkaOdevzdanychReseniView(ListView):
|
|||
self.problemy = self.problemy.non_polymorphic()
|
||||
|
||||
self.reseni = self.reseni.filter(cas_doruceni__date__gte=reseni_od, cas_doruceni__date__lte=reseni_do)
|
||||
if jen_neobodovane:
|
||||
self.reseni = self.reseni.filter(hodnoceni__body__isnull=True)
|
||||
|
||||
def get_queryset(self):
|
||||
self.inicializuj_osy_tabulky()
|
||||
|
|
Loading…
Reference in a new issue