validate delete inline formset django

First, you need to create a formset using inlineformset_factory. Then, in your view, you need to handle form validation for formset deletion. You can do this by looping through the forms in the formset and checking if the forms are marked for deletion. If a form is marked for deletion, you can perform custom validation logic. Finally, you can save the formset using the formset's save method.