Skip to content

Feature request: Add admin for softdeleted items. #6

@jorgii

Description

@jorgii

Add a SoftDeleteAdmin class that lists even soft deleted items. That could be useful to people that need to restore soft deleted items via the admin panel.

The code should be pretty simple:

from django.contrib import admin

class SoftDeleteAdmin(admin.ModelAdmin):
    def get_queryset(self, request):
        qs = self.model.raw_objects.get_queryset()
        ordering = self.get_ordering(request)
        if ordering:
            qs = qs.order_by(*ordering)
        return qs

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions