Database¶
The django_marina.db module contains database related extensions.
- class django_marina.db.models.ProtectedModelMixin[source]¶
Add checks to update and delete methods of an instance.
The use case is to protect against changes when update or delete is allowed for a user (superuser, admin or otherwise), but should not be executed because of objects that depend on this instance. In such a case, the foreign key relation to the model might benefit from on_delete=models.PROTECT.