Handling administration

Model admin

Deleted objects will also be hidden in the admin site by default. A ModelAdmin abstract class is provided to give access to deleted objects.

An undelete action is provided to undelete objects in bulk. The deleted attribute is also excluded from editing by default.

You can use the highlight_deleted method to show deleted objects in red in the admin listing.

class safedelete.admin.SafeDeleteAdmin(model, admin_site)[source]

An abstract ModelAdmin which will include deleted objects in its listing.

>>> from safedelete.admin import SafeDeleteAdmin, highlight_deleted
>>> class ContactAdmin(SafeDeleteAdmin):
...    list_display = (highlight_deleted, "first_name", "last_name", "email") + SafeDeleteAdmin.list_display
...    list_filter = ("last_name") + SafeDeleteAdmin.list_filter