Opened 19 years ago

Closed 19 years ago

Last modified 18 years ago

#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)

admin_stages_extra_context.patch (3.0 KB ) - added by plisk 19 years ago.

Download all attachments as: .zip

Change History (3)

comment:1 by rjwittams, 19 years ago

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.

comment:2 by Adrian Holovaty, 19 years ago

Resolution: wontfix
Status: newclosed

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

Note: See TracTickets for help on using tickets.
Back to Top