Re: RequestContext rarely used (branched from Feature reviews for 1.1)

2008-11-21 Thread Will McCutchen
On Nov 18, 4:40 pm, Nathaniel Whiteinge <[EMAIL PROTECTED]> wrote: > Out of curiosity, for those who want RequestContext added to > render_to_response, is there a reason you don't like using > direct_to_template instead? Holy smokes, that thought never crossed my mind, despite using both the

Re: RequestContext rarely used (branched from Feature reviews for 1.1)

2008-11-21 Thread zvoase
I understand about the loose coupling, but I think there is some misunderstanding about the very nature of 'loosely coupled'. Coupling has to do with *dependency*, not just utility. Adding a decoupled method to the request is not a restrictive assumption, it is what it is - a shortcut. No-one is

Re: RequestContext rarely used (branched from Feature reviews for 1.1)

2008-11-20 Thread Waylan Limberg
On Thu, Nov 20, 2008 at 10:23 PM, Yuri Baburov <[EMAIL PROTECTED]> wrote: > > On Thu, Nov 20, 2008 at 9:47 PM, Jeremy Dunck <[EMAIL PROTECTED]> wrote: >> >> On Thu, Nov 20, 2008 at 6:19 AM, zvoase <[EMAIL PROTECTED]> wrote: >> ... >>> # Using RequestContext >>> def myview(request, *args): >>>

Re: RequestContext rarely used (branched from Feature reviews for 1.1)

2008-11-20 Thread Yuri Baburov
On Thu, Nov 20, 2008 at 9:47 PM, Jeremy Dunck <[EMAIL PROTECTED]> wrote: > > On Thu, Nov 20, 2008 at 6:19 AM, zvoase <[EMAIL PROTECTED]> wrote: > ... >> # Using RequestContext >> def myview(request, *args): >># some code here... >>request.render('template_name.html', {...}) > ... >> >>

Re: RequestContext rarely used (branched from Feature reviews for 1.1)

2008-11-20 Thread Jeremy Dunck
On Thu, Nov 20, 2008 at 6:19 AM, zvoase <[EMAIL PROTECTED]> wrote: ... > # Using RequestContext > def myview(request, *args): ># some code here... >request.render('template_name.html', {...}) ... > > That just seems logical to me. Rather than (potentially) break > backwards compatibility,

Re: RequestContext rarely used (branched from Feature reviews for 1.1)

2008-11-20 Thread Rajeev J Sebastian
On Wed, Nov 19, 2008 at 4:10 AM, Nathaniel Whiteinge <[EMAIL PROTECTED]> wrote: > > Out of curiosity, for those who want RequestContext added to > render_to_response, is there a reason you don't like using > direct_to_template instead? I see the two as being functionally > equivalent (minus the

Re: RequestContext rarely used (branched from Feature reviews for 1.1)

2008-11-20 Thread zvoase
I have an idea which may solve the issue of render_to_response using a RequestContext. Why not have render_to_response as a shortcut in django.shortcuts (as it is now), and then add a 'render' method to the request instance which would do render_to_response but with a RequestContext instead. That

Re: RequestContext rarely used (branched from Feature reviews for 1.1)

2008-11-18 Thread Ivan Sagalaev
Nathaniel Whiteinge wrote: > Yes. It's built into Django and already does exactly what some people > want render_to_response to do, so why all the hullabaloo? (Or am I > still missing something?) The problem here is for novice users. We have two things doing roughly the same thing which is

Re: RequestContext rarely used (branched from Feature reviews for 1.1)

2008-11-18 Thread Jeremy Dunck
On Tue, Nov 18, 2008 at 9:20 PM, Nathaniel Whiteinge <[EMAIL PROTECTED]> wrote: > > On Nov 18, 5:43 pm, Ludvig Ericson <[EMAIL PROTECTED]> wrote: >> Isn't that a generic view? > > Yes. It's built into Django and already does exactly what some people > want render_to_response to do, so why all the

Re: RequestContext rarely used (branched from Feature reviews for 1.1)

2008-11-18 Thread Nathaniel Whiteinge
On Nov 18, 5:43 pm, Ludvig Ericson <[EMAIL PROTECTED]> wrote: > Isn't that a generic view? Yes. It's built into Django and already does exactly what some people want render_to_response to do, so why all the hullabaloo? (Or am I still missing something?)

Re: RequestContext rarely used (branched from Feature reviews for 1.1)

2008-11-18 Thread Collin Grady
On Tue, Nov 18, 2008 at 4:43 PM, Ludvig Ericson <[EMAIL PROTECTED]> wrote: > And that's very doable, and I'm with you on this. I hate having to > pass context_instance. Long lines. Although nothing stops someone from writing their own wrapper if they don't like direct_to_template for some reason

Re: RequestContext rarely used (branched from Feature reviews for 1.1)

2008-11-18 Thread Ludvig Ericson
> Then why not just change the docs/tutorial to use or mention > direct_to_template instead? > > Granted, there is a bit of momentum behind render_to_response, but if > the docs are changed it will just be the status quo until that time > people start catching on to the simpler method. Isn't

Re: RequestContext rarely used (branched from Feature reviews for 1.1)

2008-11-18 Thread David Zhou
On Tue, Nov 18, 2008 at 5:40 PM, Nathaniel Whiteinge <[EMAIL PROTECTED]> wrote: >my Python-foo is not strong, is there a reason I should > avoid using direct_to_template in 99% of my views? I think if people are already using RequestContext 99% of the time, then render_to_response should

Re: RequestContext rarely used (branched from Feature reviews for 1.1)

2008-11-18 Thread Nathaniel Whiteinge
Out of curiosity, for those who want RequestContext added to render_to_response, is there a reason you don't like using direct_to_template instead? I see the two as being functionally equivalent (minus the addition of RequestContext, of course), but this debate crops up every so often -- is there

Re: RequestContext rarely used (branched from Feature reviews for 1.1)

2008-11-18 Thread Ivan Sagalaev
Adrian Holovaty wrote: > Yuri, to answer your question: I try never to send the request object > into a template context Uhm... But using RequestContext is not about it. Everyone I know uses RequestContext almost exclusively (i.e. nobody uses standard render_to_response with plain Context

Re: RequestContext rarely used (branched from Feature reviews for 1.1)

2008-11-17 Thread Adrian Holovaty
On Tue, Nov 18, 2008 at 12:42 AM, James Bennett <[EMAIL PROTECTED]> wrote: > On Tue, Nov 18, 2008 at 12:04 AM, Yuri Baburov <[EMAIL PROTECTED]> wrote: >> I'm always wondeing how it's possible that Django creators don't use >> django in ways that are written in django documentation. That leads to

Re: RequestContext rarely used (branched from Feature reviews for 1.1)

2008-11-17 Thread Mike Scott
For all three of our projects in django, we've gone through and used our own exended version of render_to_response, which uses RequestContext by default. Its such a blessing. On Tue, Nov 18, 2008 at 7:42 PM, James Bennett <[EMAIL PROTECTED]>wrote: > > On Tue, Nov 18, 2008 at 12:04 AM, Yuri

Re: RequestContext rarely used (branched from Feature reviews for 1.1)

2008-11-17 Thread James Bennett
On Tue, Nov 18, 2008 at 12:04 AM, Yuri Baburov <[EMAIL PROTECTED]> wrote: > I'm always wondeing how it's possible that Django creators don't use > django in ways that are written in django documentation. That leads to > misunderstanding in expectations, and should explain why some tickets > don't