#1125 closed enhancement (wontfix)
[patch] Add extra_context to admin stages
Reported by: | plisk | Owned by: | Adrian Holovaty |
---|---|---|---|
Component: | contrib.admin | Version: | |
Severity: | normal | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
New admin now allows to override templates, but there is no way to add additional context params to your new templates. Proposed patch adds new param extra_context to change_list, add_stage and change_stage views similar to the one used in generic views.
Also i think loop used to add params to context should be refactored to 1 function, cos its used in many places in generic views and with this patch in 3 places more in admin views. And name it for example django.utils.functional.context_add_extra. Any comments ?
Attachments (1)
Change History (3)
by , 19 years ago
Attachment: | admin_stages_extra_context.patch added |
---|
comment:1 by , 19 years ago
comment:2 by , 19 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
Instead of extra_context, use the TEMPLATE_CONTENT_PROCESSORS framework added a couple of days ago:
http://www.djangoproject.com/documentation/templates_python/#subclassing-context-djangocontext
This seems kind of odd. How is the extra context going to get filled? It doesn't seem sensible for people to be mashing with the admin url conf.
A better way to get stuff into the context is to make a processor. See #925 which was applied. If your information does not come from the request, you can just make a template tag to fetch it.