Just coming back to Django after an 18 month absense, great to see some of the work that's gone on here, i'm really impressed! Been using Rails for a while (not by choice) and it's a joy to get back into Django.
Enough of the fluffing though, and down to business.
render_to_response is a great shortcut, however in my opinion it's let down by not supporting request. I see this has been discussed a bit on the ticket, however that's more in respect to replacing the existing shortcut.
On 6/26/07, Paul Bowsher <paul.bows...@gmail.com> wrote:
> render_to_response is a great shortcut, however in my opinion it's let > down by not supporting request. I see this has been discussed a bit on > the ticket, however that's more in respect to replacing the existing > shortcut.
Isn't this just the 'direct_to_template' generic view?
No, this is meant to go at the end of a long view function def index(request): # Lots of code render_to_response_with_req(request, 'home/index.html', {'a': 'dict'})
etc.
On 6/27/07, Russell Keith-Magee <freakboy3...@gmail.com> wrote:
> On 6/26/07, Paul Bowsher <paul.bows...@gmail.com> wrote:
> > render_to_response is a great shortcut, however in my opinion it's let > > down by not supporting request. I see this has been discussed a bit on > > the ticket, however that's more in respect to replacing the existing > > shortcut.
> Isn't this just the 'direct_to_template' generic view?
On Jun 27, 8:46 pm, "Paul Bowsher" <paul.bows...@gmail.com> wrote:
> No, this is meant to go at the end of a long view function > def index(request): > # Lots of code > render_to_response_with_req(request, 'home/index.html', {'a': 'dict'})
Firstly, you should be `return`ing this request. ;)
Secondly, it looks like the direct_to_template function does exactly this (albeit with a tiny bit of overhead in checking for and calling callable context items).
Yes, sorry, I missed the return, was hastily typed as an example. Hadn't seen direct_to_template, that does indeed seem like a good way to go. Thanks for the pointer :)
On 6/27/07, SmileyChris <smileych...@gmail.com> wrote:
> On Jun 27, 8:46 pm, "Paul Bowsher" <paul.bows...@gmail.com> wrote: > > No, this is meant to go at the end of a long view function > > def index(request): > > # Lots of code > > render_to_response_with_req(request, 'home/index.html', {'a': > 'dict'})
> Firstly, you should be `return`ing this request. ;)
> Secondly, it looks like the direct_to_template function does exactly > this (albeit with a tiny bit of overhead in checking for and calling > callable context items).