Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#1125 closed enhancement (wontfix)

[patch] Add extra_context to admin stages

Reported by: plisk Owned by: adrian
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: UI/UX:

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 9 years ago.

Download all attachments as: .zip

Change History (3)

Changed 9 years ago by plisk

comment:1 Changed 9 years ago by rjwittams

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 Changed 9 years ago by adrian

  • Resolution set to wontfix
  • Status changed from new to 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

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