-
-
Notifications
You must be signed in to change notification settings - Fork 480
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add show deleted objects filter #1169
base: master
Are you sure you want to change the base?
Conversation
c218865
to
9b9bd0a
Compare
Codecov Report
@@ Coverage Diff @@
## master #1169 +/- ##
==========================================
- Coverage 97.30% 96.26% -1.04%
==========================================
Files 23 23
Lines 1260 1286 +26
Branches 204 206 +2
==========================================
+ Hits 1226 1238 +12
- Misses 16 30 +14
Partials 18 18
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
There's another peculiarity in this patchset that I'de like to see if I can find a work around for: the Would there be any way to coerce a queryset of historical changes to a queryset of the underlying Functionally, what I want is this: queryset.model.history.filter(history_type='-').latest_of_each().values("history_object") but this doesn't work since Additionally, since the database objects that we're filtering by are deleted anyways, would it be possible to get a queryset containing them? How |
0c116b1
to
2ccf550
Compare
Note that if you are using any custom methods on the model for the admin display, you need to use a History Base class for this to work(jazzband#311).
I think the ChangeList.apply_select_related() method might have changed.
.distinct() -> .latest_of_each() prevents multiple deletes from adding multiple rows for the same object.
for more information, see https://pre-commit.ci
Description
Code taken from #72, combined into a commit & tidied up a bit.
Related Issue
Fixes #72
Motivation and Context
Allows to see deleted objects from admin page.
How Has This Been Tested?
Manually (for now).
Screenshots (if appropriate):
Types of changes
Checklist:
pre-commit run
command to format and lint.AUTHORS.rst
CHANGES.rst
Of note is that this is a joint PR, most of the code has been contributed by @marco-silva0000, @rhaver, & @duebbert.
I don't know if we'll need their explicit sign-off for this, but I figure the attribution would be good.