def save(self, *args, **kwargs):

        if self.instance:
            if self.is_valid():
                if self.cleaned_data['delete']:
                    if self.cleaned_data['delete'] == 'delete':
                        self.instance.delete()
                    if self.cleaned_data['delete'] == 'trash':
                        self.instance.trash = True
                        self.instance.save()
Process form
dataset/ETHPy150Open treeio/treeio/treeio/documents/forms.py/MassActionForm.save