I override delete
method (have made object non-deleteable and set 'active' field to false) in custom QuerySet
in custom ModelManager
.
Is there any way to ignore custom manager in admin panel so I can actually delete objects from there?
edit 1
First thought: I can specify another name for custom Manager. But now it's treated as default... And how to bypass obj.delete()?
edit 2
Solution for first problem is to add custom manager alongside with default:
objects = models.Manager()
active_manager = EventManager()
Solution to second problem is to add param to the custom delete
method:
def delete(self, *args, **kwargs):
force = kwargs.pop('force', False)
...