Unclear why shortcut function "render" can not return TemplateResponse object
|Reported by:||jgehrs@…||Owned by:||nobody|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||yes|
The reason is - apparently - that this is pointless as TemplateResponse has a constructor with a syntax equivalently convenient as render().
I have created a pull request and I suggest to update the documentation accordingly. I was confused by the fact that TemplateResponse is not even mentioned in the shortcut section, although using it should be a rather common thing. It gives the impression that TemplateResponse is a "2nd class citizen".
Here's a link to the pull request: https://github.com/django/django/pull/2053
Change History (3)
comment:1 Changed 15 months ago by timo
- Needs documentation unset
- Needs tests unset
- Patch needs improvement set
- Triage Stage changed from Unreviewed to Accepted
comment:2 Changed 15 months ago by Tim Graham <timograham@…>
- Resolution set to fixed
- Status changed from new to closed