|
@ -82,6 +82,13 @@ class NahrajReseniForm(forms.ModelForm): |
|
|
) |
|
|
) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
def __init__(self, *args, **kwargs): |
|
|
|
|
|
super().__init__(*args, **kwargs) |
|
|
|
|
|
# FIXME Z nějakého důvodu se do této třídy dostaneme i bez resitele |
|
|
|
|
|
if 'resitele' in self.fields: |
|
|
|
|
|
# FIXME Mnohem hezčí by to bylo u definice resitele výše, ale nepodařilo se mi to. |
|
|
|
|
|
self.fields['resitele'].required = False |
|
|
|
|
|
|
|
|
ReseniSPrilohamiFormSet = inlineformset_factory(m.Reseni,m.PrilohaReseni, |
|
|
ReseniSPrilohamiFormSet = inlineformset_factory(m.Reseni,m.PrilohaReseni, |
|
|
form = NahrajReseniForm, |
|
|
form = NahrajReseniForm, |
|
|
fields = ('soubor','res_poznamka'), |
|
|
fields = ('soubor','res_poznamka'), |
|
|