We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b5eadd5 commit 3f38d97Copy full SHA for 3f38d97
simple_history/admin.py
@@ -284,3 +284,18 @@ def enforce_history_permissions(self):
284
return getattr(
285
settings, "SIMPLE_HISTORY_ENFORCE_HISTORY_MODEL_PERMISSIONS", False
286
)
287
+
288
289
+class SimpleHistoryShowDeletedFilter(admin.SimpleListFilter):
290
+ title = "Entries"
291
+ parameter_name = "entries"
292
293
+ def lookups(self, request, model_admin):
294
+ return (
295
+ ("deleted_only", "Only Deleted"),
296
+ )
297
298
+ def queryset(self, request, queryset):
299
+ if self.value():
300
+ return queryset.model.history.filter(history_type='-').distinct()
301
+ return queryset
0 commit comments