[Answer]-Django – Remove the Checkbox in ClearableFileInput widget

1👍

I think this is to do with the inlineformset_factory applying a default can_delete parameter set to true, which was present regardless of how I’d prepared the form to use with it. Simply passing can_delete=False got rid of the Delete checkbox.

SpecImageFormSet = inlineformset_factory(Spec, SpecImage, form=SpecImageForm, extra=1, max_num=1, can_delete=False)

In addition when I rendered the form on it’s own (without using inlineformset_factory) there was no sign of a ‘Delete checkbox’. Then I found this SO post that explained why.

Getting there.

👤jayuu

Leave a comment