Opened 12 years ago

Closed 12 years ago

Last modified 11 years ago

#15010 closed (fixed)

TemplateResponse: add current_app parameter for RequestContext

Reported by: Chris Adams Owned by: Chris Adams
Component: Template system Version: dev
Severity: Keywords: blocker
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: yes
Needs tests: no Patch needs improvement: yes
Easy pickings: no UI/UX: no

Description

#15008 converts admin to return TemplateResponse instances. The patch is complicated by the fact that we still have to create RequestContext instances manually to set current_app in many places. This branch / patch changes TemplateResponse to pass through the current_app value when creating a RequestContext instance dynamically:

https://github.com/acdha/django/compare/master...template-response-current_app
https://github.com/acdha/django/compare/master...template-response-current_app.patch

Attachments (3)

template-response-current_app.2.txt (12.7 KB) - added by Chris Adams 12 years ago.
template-response-current_app.txt (12.7 KB) - added by Chris Adams 12 years ago.
template-response-current_app.patch (12.7 KB) - added by Chris Adams 12 years ago.

Download all attachments as: .zip

Change History (10)

comment:1 Changed 12 years ago by Russell Keith-Magee

Needs documentation: set
Patch needs improvement: set
Triage Stage: UnreviewedAccepted

Good catch. For the record, the same problem exists with the render() shortcut. Marking needs improvement so that we can roll that fix into the same commit.

Also requires docs.

Since this is a functional flaw in a 1.3 feature, this should be a 1.3 blocker.

comment:2 Changed 12 years ago by Chris Adams

Owner: changed from nobody to Chris Adams

Added the render shortcut and some basic documentation here, which is the commit used for the updated patch:

https://github.com/acdha/django/commit/d1024ace8965230d5eac7d2a7a8cefeeefc3b36d

Do you have any suggestions for further improvements?

Also, at this point, I should assume that it's safe to update #15008 to assume that this change will be included, right?

Changed 12 years ago by Chris Adams

Changed 12 years ago by Chris Adams

Changed 12 years ago by Chris Adams

comment:3 Changed 12 years ago by Chris Adams

Status: newassigned

Updated patch and corrected the filename

comment:4 in reply to:  2 Changed 12 years ago by Jannis Leidel

Replying to acdha:

Added the render shortcut and some basic documentation here, which is the commit used for the updated patch:

Also, at this point, I should assume that it's safe to update #15008 to assume that this change will be included, right?

Yup.

comment:5 Changed 12 years ago by Russell Keith-Magee

Keywords: blocker added

comment:6 Changed 12 years ago by Jannis Leidel

Resolution: fixed
Status: assignedclosed

(In [15153]) Fixed #15010 -- Added current_app parameter to close gap between TemplateResponse and render method. Thanks, acdha.

comment:7 Changed 11 years ago by Jacob

milestone: 1.3

Milestone 1.3 deleted

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