#12816 closed (fixed)
Add a render() shortcut
Reported by: | Russell Keith-Magee | Owned by: | Ivan Sagalaev |
---|---|---|---|
Component: | Core (Other) | Version: | |
Severity: | Keywords: | ||
Cc: | Alexander Koshelev, Mikhail Korobov | Triage Stage: | Accepted |
Has patch: | yes | Needs documentation: | yes |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
render_to_response(template, view, context_instance=RequestContext(request)) is such a common idiom that it deserves a shortcut of it's own.
Related: #12815 If we're going to introduce a new TemplateResponse, it might be appropriate for a new render() shortcut to return that class.
Attachments (7)
Change History (17)
comment:1 by , 15 years ago
Component: | Uncategorized → Core framework |
---|---|
Triage Stage: | Unreviewed → Accepted |
comment:2 by , 14 years ago
Cc: | added |
---|---|
Owner: | changed from | to
Status: | new → assigned |
comment:3 by , 14 years ago
Owner: | removed |
---|---|
Status: | assigned → new |
comment:4 by , 14 years ago
Cc: | added |
---|---|
milestone: | → 1.3 |
Needs documentation: | set |
Needs tests: | set |
Owner: | set to |
by , 14 years ago
Attachment: | render_shortcut.diff added |
---|
django.shortcuts.render implemented as TemplateResponse, with tests but without docs
comment:5 by , 14 years ago
Has patch: | set |
---|---|
Needs tests: | unset |
trac doesn't want to show diff properly.
Here is the alternative: http://bitbucket.org/kmike/django/changeset/5c98028837aa
by , 14 years ago
Attachment: | render_shortcut.2.diff added |
---|
django.shortcuts.render implemented as TemplateResponse, with tests but without docs
comment:6 by , 14 years ago
The first diff has broken test. Here is the correct one: http://bitbucket.org/kmike/django/changeset/37d977574923
by , 14 years ago
Attachment: | render_shortcut.3.diff added |
---|
more tests and changed _set_content behaviour
by , 14 years ago
Attachment: | render_shortcut.5.diff added |
---|
generic views integration, fixed test client and messages middleware
by , 14 years ago
Attachment: | render_shortcut.6.diff added |
---|
force_bake is removed, template response middleware is introduces, exception is raised on content access for unbaked responses, more tests and some docs
comment:7 by , 14 years ago
Owner: | removed |
---|
comment:8 by , 14 years ago
Owner: | set to |
---|
comment:9 by , 14 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Jacob, Simon, and others are on the record as being in favor. The only hesitation is the relationship with #12815; we should resolve that decision before committing anything for this ticket.