Opened 4 years ago

Last modified 4 years ago

#24117 new Cleanup/optimization

make admin not require context_processors

Reported by: Collin Anderson Owned by: nobody
Component: contrib.admin Version: master
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: yes
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description


Change History (9)

comment:1 Changed 4 years ago by Collin Anderson

Has patch: set

comment:2 Changed 4 years ago by Tim Graham

Needs documentation: set
Triage Stage: UnreviewedAccepted

AdminSite.each_context() documentation needs to be updated. The release notes should encourage its use in light of this change. It would be helpful to add a summary of the IRC discussion that led to this ticket in the ticket description for posterity.

comment:3 Changed 4 years ago by Collin Anderson

Ok. I tried to summarize the IRC discussion here: https://groups.google.com/d/topic/django-developers/WlK_7OoThaQ/discussion

comment:4 Changed 4 years ago by Collin Anderson

Ok, I updated the each_context() docs.

The new variables should work just fine without each_context() as long as you had the context_processors installed previously, so it seems to me it's a little different case than has_permission. Right?

comment:5 Changed 4 years ago by Tim Graham

Right, the case I am thinking of is someone adding custom admin views as third-party app or something. They should no longer assume their users have all the context processors enabled and so should be sure to add each_context() to their views.

comment:6 Changed 4 years ago by Collin Anderson

This is the minimum change needed for the current context_processors proposal.

https://github.com/django/django/pull/3896

comment:7 Changed 4 years ago by Tim Graham <timograham@…>

In 58833f519797e15ae3cb39b1613e5f7e09c96952:

Made Django's templates get their own LANGUAGE_* variables.

Refs #24117

comment:8 Changed 4 years ago by Collin Anderson

For "messages" and "user", I'd be interested in looking into the possibility of passing "request" to the template and using "request.messages" (a new "feature" I have half implemented in my stash) and "request.user" in the templates.

comment:9 Changed 4 years ago by Collin Anderson

But I was thinking it might be better to defer until 1.9 for that.

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