Opened 9 years ago

Closed 9 years ago

#4756 closed (wontfix)

Mention direct_to_template as an alternate shortcut when wanting RequestContext

Reported by: SmileyChris Owned by: nobody
Component: Documentation Version: master
Severity: Keywords:
Cc: Triage Stage: Design decision needed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


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 SmileyChris 9 years ago.

Download all attachments as: .zip

Change History (4)

Changed 9 years ago by SmileyChris

comment:1 Changed 9 years ago by SmileyChris

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Design decision needed

comment:2 Changed 9 years ago by ubernostrum

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 Changed 9 years ago by ubernostrum

  • Resolution set to wontfix
  • Status changed from new to 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).

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