Opened 8 years ago
Closed 8 years ago
#27313 closed Cleanup/optimization (fixed)
Allow overriding the admin's popup response template on an app or model basis
Reported by: | Ustun Ozgur | Owned by: | Michael Scott |
---|---|---|---|
Component: | contrib.admin | Version: | 1.10 |
Severity: | Normal | Keywords: | admin popup templates |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | yes | UI/UX: | no |
Description
In admin, popup response template ( admin/popup_response.html ) is project global, unlike change_form or change_list which can be overridden on an app or model basis.
Compare:
to
https://github.com/django/django/blob/master/django/contrib/admin/options.py#L1064-L1067
Seems like an easy change and I would like to submit a patch in case there is a particular reason (security?) this is not customizable.
popup_response.html was originally added by this ticket: https://code.djangoproject.com/ticket/19773
Change History (6)
comment:1 by , 8 years ago
Type: | Bug → Cleanup/optimization |
---|
comment:2 by , 8 years ago
In my particular case, I'm using django-selectable library. It provides autocomplete, but lacks it for M2M fields. So, I need some custom JS which basically needs some more data for a particular model so that I can inject it into the opener page.
comment:3 by , 8 years ago
Summary: | Admin: Popup Response Template Needs to Be Overridable on an App or Model Basis → Allow overriding the admin's popup response template on an app or model basis |
---|---|
Triage Stage: | Unreviewed → Accepted |
comment:4 by , 8 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
I'll pick this up and see if I can make the suggested change.
comment:5 by , 8 years ago
Has patch: | set |
---|
Sorry its taken a while but I've finally created a PR to make the proposed changes. Please let me know if there are any issues with the changes or potential improvements.
Probably the use case was never considered. Could you give one?