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 a768673 commit 2c71785Copy full SHA for 2c71785
simple_history/admin.py
@@ -283,3 +283,16 @@ def enforce_history_permissions(self):
283
return getattr(
284
settings, "SIMPLE_HISTORY_ENFORCE_HISTORY_MODEL_PERMISSIONS", False
285
)
286
+
287
288
+class SimpleHistoryShowDeletedFilter(admin.SimpleListFilter):
289
+ title = "Entries"
290
+ parameter_name = "entries"
291
292
+ def lookups(self, request, model_admin):
293
+ return (("deleted_only", "Only Deleted"),)
294
295
+ def queryset(self, request, queryset):
296
+ if self.value():
297
+ return queryset.model.history.filter(history_type="-").distinct()
298
+ return queryset
0 commit comments