Opened 22 months ago
Closed 22 months ago
#34303 closed New feature (fixed)
Admin Site shall filter LogEntries by registered models
Reported by: | Jacob Rief | Owned by: | nobody |
---|---|---|---|
Component: | contrib.admin | Version: | dev |
Severity: | Normal | Keywords: | LogEntry |
Cc: | Triage Stage: | Ready for checkin | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
This ticket has been discussed here: https://groups.google.com/g/django-developers/c/OyTo0P2TfAE
If an implementer registers more than one AdminSite
, one might expect that only changes on models registered at that specific site are logged.
This currently is not the case, all registered sites show all entries of LogEntry
. It is confusing for users to access a specific site and see log entries for models they can't access.
Change History (8)
comment:1 by , 22 months ago
Needs documentation: | set |
---|---|
Patch needs improvement: | set |
Triage Stage: | Unreviewed → Accepted |
comment:2 by , 22 months ago
Type: | Cleanup/optimization → New feature |
---|
comment:3 by , 22 months ago
Needs tests: | set |
---|---|
Version: | 4.2 → dev |
comment:4 by , 22 months ago
Needs tests: | unset |
---|
Since this modification does not change the functionality, I didn't add any extra tests.
comment:5 by , 22 months ago
Needs tests: | set |
---|
There are some review comments on the PR, plus a test showing the new hook in action is needed.
(If you can squash and such to get it ready for commit, that's great, but merger can do that if it's tricky for you.)
comment:6 by , 22 months ago
- has test to show documented example works
- PR is squashed
- renamed
log_entry_queryset
->get_log_entries
comment:7 by , 22 months ago
Needs documentation: | unset |
---|---|
Needs tests: | unset |
Patch needs improvement: | unset |
Triage Stage: | Accepted → Ready for checkin |
I'm always sceptical about new Admin API, but I'm going to Accept this, as I can see the use-case. (+0)
I've left comments on the first PR. Summary: IMO, we should add only the minimal hook to let folks customise the
LogEntry
QuerySet, and document that, but not add the initially suggested helper methods and AdminSite flag attributes.