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.
--
Ticket URL: <https://code.djangoproject.com/ticket/34303>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* needs_better_patch: 0 => 1
* stage: Unreviewed => Accepted
* needs_docs: 0 => 1
Comment:
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
[https://github.com/django/django/pull/16508#pullrequestreview-1276649792
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.
--
Ticket URL: <https://code.djangoproject.com/ticket/34303#comment:1>
* type: Cleanup/optimization => New feature
--
Ticket URL: <https://code.djangoproject.com/ticket/34303#comment:2>
* version: 4.2 => dev
* needs_tests: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/34303#comment:3>
* needs_tests: 1 => 0
Comment:
Since this modification does not change the functionality, I didn't add
any extra tests.
--
Ticket URL: <https://code.djangoproject.com/ticket/34303#comment:4>
* needs_tests: 0 => 1
Comment:
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.)
--
Ticket URL: <https://code.djangoproject.com/ticket/34303#comment:5>
Comment (by Jacob Rief):
* has test to show documented example works
* PR is squashed
* renamed `log_entry_queryset` -> `get_log_entries`
--
Ticket URL: <https://code.djangoproject.com/ticket/34303#comment:6>
* needs_better_patch: 1 => 0
* stage: Accepted => Ready for checkin
* needs_tests: 1 => 0
* needs_docs: 1 => 0
--
Ticket URL: <https://code.djangoproject.com/ticket/34303#comment:7>
* status: new => closed
* resolution: => fixed
Comment:
In [changeset:"473283d2414fa4bbf1e38d663fe4a58f49bf72b9" 473283d]:
{{{
#!CommitTicketReference repository=""
revision="473283d2414fa4bbf1e38d663fe4a58f49bf72b9"
Fixed #34303 –- Allowed customizing admin site log entry list.
Added AdminSite.get_log_entries() as an override point and made this
available to the template via each_context().
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/34303#comment:8>