Opened 17 years ago
Closed 17 years ago
#4756 closed (wontfix)
Mention direct_to_template as an alternate shortcut when wanting RequestContext
Reported by: | Chris Beaven | Owned by: | nobody |
---|---|---|---|
Component: | Documentation | Version: | dev |
Severity: | Keywords: | ||
Cc: | Triage Stage: | Design decision needed | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Currently the docs suggest passing a RequestContext instance to the render_to_response()
shortcut. But that means also importing RequestContext which makes it a bit less "short" and the actual "cut" less concise.
Perhaps we could mention using the simple generic view direct_to_template()
as an alternate shortcut?
Attachments (1)
Change History (4)
by , 17 years ago
Attachment: | 4756.patch added |
---|
comment:1 by , 17 years ago
Triage Stage: | Unreviewed → Design decision needed |
---|
comment:2 by , 17 years ago
comment:3 by , 17 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
And on further reflection, I'm going to stand by the above comment and mark this "wontfix"; direct_to_template
really isn't appropriate for a case where you just want to get a RequestContext
in your view (since in either case you have to import something and change the way your view function returns).
I'd be inclined not to do this because they're really not the same thing; if you just want to render a template, use
direct_to_template
. But if you want to do more, writing a wrapper view which looks stuff up and callsdirect_to_template
with a dictionary of variables is probably more work than just writing a view which usesRequestContext
to do the same thing.