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
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
2 matches
Mail list logo