Opened 14 years ago

Closed 14 years ago

Last modified 13 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 14 years ago.
template-response-current_app.txt (12.7 KB ) - added by Chris Adams 14 years ago.
template-response-current_app.patch (12.7 KB ) - added by Chris Adams 14 years ago.

Download all attachments as: .zip

Change History (10)

comment:1 by Russell Keith-Magee, 14 years ago

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 by Chris Adams, 14 years ago

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?

by Chris Adams, 14 years ago

by Chris Adams, 14 years ago

by Chris Adams, 14 years ago

comment:3 by Chris Adams, 14 years ago

Status: newassigned

Updated patch and corrected the filename

in reply to:  2 comment:4 by Jannis Leidel, 14 years ago

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 by Russell Keith-Magee, 14 years ago

Keywords: blocker added

comment:6 by Jannis Leidel, 14 years ago

Resolution: fixed
Status: assignedclosed

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

comment:7 by Jacob, 13 years ago

milestone: 1.3

Milestone 1.3 deleted

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