PlaceImageForm Filename required

This commit is contained in:
reverend 2020-07-30 22:18:55 +02:00
parent bf0d20dbbd
commit fc4167ffc2

View File

@ -25,5 +25,10 @@ class PlaceImageCreateForm(forms.ModelForm):
fields = '__all__'
exclude = ['submitted_by', 'place', 'description']
widgets = {
'filename': forms.ClearableFileInput(attrs={'multiple': True})
}
'filename': forms.ClearableFileInput(attrs={'multiple': True}),
},
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
print(self.fields)
self.fields['filename'].required = False