Opened 15 years ago
Closed 7 years ago
#11974 closed New feature (fixed)
Submit_row in admin doesn't follow the pattern of using admin/app_label/model/submit_line.html
Reported by: | vbmendes | Owned by: | Raffaele Salmaso |
---|---|---|---|
Component: | contrib.admin | Version: | |
Severity: | Normal | Keywords: | django admin templates |
Cc: | vbmendes, jedie, Andy Baker, andy@…, jgbreezer@…, raffaele.salmaso+djangoproject@… | Triage Stage: | Accepted |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
The admin's submit_row template tag does not follow the pattern for searching for templates: admin/app_label/model/submit_line.html
And it would be nice if it supports since it will be easier to override this template.
I made a patch that add this support.
Attachments (1)
Change History (16)
by , 15 years ago
Attachment: | admin_modify.diff added |
---|
comment:1 by , 15 years ago
Cc: | added; removed |
---|
comment:2 by , 15 years ago
Triage Stage: | Unreviewed → Design decision needed |
---|
comment:3 by , 14 years ago
Cc: | added |
---|
comment:4 by , 14 years ago
Needs documentation: | set |
---|---|
Needs tests: | set |
Triage Stage: | Design decision needed → Accepted |
comment:6 by , 14 years ago
Cc: | added |
---|---|
Severity: | → Normal |
Type: | → Uncategorized |
comment:7 by , 14 years ago
Easy pickings: | unset |
---|---|
Type: | Uncategorized → New feature |
Version: | 1.1 |
comment:8 by , 13 years ago
Cc: | added |
---|---|
Needs documentation: | unset |
Needs tests: | unset |
UI/UX: | unset |
I am fairly sure it doesn't need tests or docs on the grounds that:
- We haven't documented the template structure of many similar parts of the admin
- We don't have specific tests for the template structure of other parts of the admin.
comment:9 by , 13 years ago
Needs documentation: | set |
---|---|
Needs tests: | set |
Patch needs improvement: | set |
In fact there are several tests for using custom templates (e.g. source:django/trunk/tests/regressiontests/admin_views/tests.py?rev=16498#L608), so this definitely needs to be tested and documented as part of the "Overriding admin templates" docs (https://docs.djangoproject.com/en/dev//ref/contrib/admin/#overriding-admin-templates).
comment:10 by , 12 years ago
Cc: | added |
---|
comment:11 by , 8 years ago
Cc: | added |
---|---|
Needs tests: | unset |
Added a PR => https://github.com/django/django/pull/7782
Hi, I've usually customize the submit row of many models in my admin.
At first I've used a similar strategy from the former patch (using render_to_string), but while working with my setup (only one admin.site), half of admin_views tests were broken. So this is why I used the InclusionNode for SubmitRowNode parent class.
Additionally I've added a { block submit-row %}{% endblock %} in default submit_line.html.
comment:12 by , 8 years ago
Needs documentation: | unset |
---|---|
Patch needs improvement: | unset |
Don't forget to uncheck the "needs improvement" flags on the ticket, else it won't appear in the review queue.
comment:13 by , 8 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:14 by , 7 years ago
Has patch: | unset |
---|
PR for this was closed but this should be resolved with #27728.
comment:15 by , 7 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
This was resolved by #27728, which allowed overriding admin templatetag's templates.
Patch for the submit_rows template tag. With this, it will follow the template naming pattern of the admin.