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)

4756.patch (1.4 KB ) - added by Chris Beaven 17 years ago.

Download all attachments as: .zip

Change History (4)

by Chris Beaven, 17 years ago

Attachment: 4756.patch added

comment:1 by Chris Beaven, 17 years ago

Triage Stage: UnreviewedDesign decision needed

comment:2 by James Bennett, 17 years ago

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 calls direct_to_template with a dictionary of variables is probably more work than just writing a view which uses RequestContext to do the same thing.

comment:3 by James Bennett, 17 years ago

Resolution: wontfix
Status: newclosed

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).

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