Re: Django: Form validation strange behaviour

2017-09-29 Thread Constantine Covtushenko
Hi Paul, You should return value from 'clean_document'. >From your code I see you do not do that. When method returns nothing it is None. That is why you see 'This field cannot be blank.' I hope that make sense. Regards, Constantine C. On Fri, Sep 29, 2017 at 7:01 AM, Paul wrote: > I want to

Django: Form validation strange behaviour

2017-09-29 Thread Paul
I want to do file validation(size,type) on a field on inlineformset. class ProductDocumentModelForm(ModelForm): class Meta: model = ProductDocument fields = ['document'] def clean_document(self): file = self.cleaned_data['document'] validate_file(file, 'document') Becau