Opened 18 years ago
Last modified 9 years ago
#2901 new New feature
Enable admin log display to be restricted to a specific site
Reported by: | Owned by: | nobody | |
---|---|---|---|
Component: | contrib.admin | Version: | newforms-admin |
Severity: | Normal | Keywords: | nfa-someday |
Cc: | cmlenz@… | Triage Stage: | Accepted |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | yes |
Easy pickings: | no | UI/UX: | no |
Description
The admin log currently only provides way to show changes across all sites. For a project with multiple sites, it'd be very nice to be able to tell the admin log template tag to only show changes to objects that either aren't associated with any site, or associated with the current (or some other specific) site.
This requires the django_admin_log
table to be extended with a nullable site_id
column, which would require appropriate upgrade instructions ala:
BEGIN; ALTER TABLE django_admin_log ADD site_id integer NULL REFERENCES django_site (id); COMMIT;
The patch adds a method called get_for_obj
to the SiteManager
class, which attempts to find the site a given object is related with (either through a many-to-many, or a many-to-one relation). This function is reused in the django.views.defaults.shortcut
function, which needs the same thing.
Attachments (2)
Change History (12)
by , 18 years ago
Attachment: | admin_log_with_site.diff added |
---|
comment:1 by , 18 years ago
Cc: | added |
---|
by , 18 years ago
Attachment: | admin_log_with_site.2.diff added |
---|
Fixed patch, previous one didn't correctly filter the template tag output
follow-up: 4 comment:2 by , 18 years ago
This is a good patch, and the get_for_site() method is a great idea. We probably should wait to apply this until before an actual release to avoid model breakage midstream, though... I'm not sure what our policy is on handling things like that.
comment:3 by , 18 years ago
Triage Stage: | Unreviewed → Ready for checkin |
---|---|
Version: | 0.95 → SVN |
Marked as Ready-for-checkin, given Jacob's comment above, and now (prior to 1.0) is probably the best time to do it.
comment:4 by , 18 years ago
Replying to jacob:
This is a good patch, and the get_for_site() method is a great idea. We probably should wait to apply this until before an actual release to avoid model breakage midstream, though... I'm not sure what our policy is on handling things like that.
Don't you mean *just after* an actual release? Otherwise everybody who has been following svn leading up to the release gets bonus code breakage on the day of the release (or just before). If we make a backwards-compat change the day after a release, it will mean that people can stabilise on the released version until they feel like making the changes, without fear of missing any intermediate bug fixes (which is the argument against doing it months after a release).
comment:5 by , 17 years ago
Patch needs improvement: | set |
---|---|
Summary: | [patch] Enable admin log display to be restricted to a specific site → [newforms-admin] Enable admin log display to be restricted to a specific site |
Triage Stage: | Ready for checkin → Accepted |
We're not making any more changes to existing admin, since it has limited lifespan. So the patch needs to be update for newforms-admin and applied whenever the maintainers of that branch can handle the backwards incompatibility (when newforms-admin is merged to trunk, all code using existing admin needs changing anyway, so this becomes part of that).
comment:8 by , 17 years ago
Keywords: | nfa-someday added |
---|---|
Version: | SVN → newforms-admin |
This functionality isn't critical to the merging of newforms-admin with trunk. Tagging with nfa-someday so it can be looked later.
comment:9 by , 14 years ago
Severity: | normal → Normal |
---|---|
Type: | enhancement → New feature |
comment:12 by , 10 years ago
Summary: | [newforms-admin] Enable admin log display to be restricted to a specific site → Enable admin log display to be restricted to a specific site |
---|
Patch as described above