Re: idea for using RequestContext by default

2010-01-05 Thread Jacob Kaplan-Moss
On Tue, Jan 5, 2010 at 9:38 AM, Russell Keith-Magee wrote: > To clarify your position Jacob - are you advocating that > shortcuts.render() should return a TemplateReponse? Or are you > suggesting that we add a TemplateResponse *and* a shortcut.render() > that is an analog of render_to_response, bu

Re: idea for using RequestContext by default

2010-01-05 Thread Russell Keith-Magee
On Tue, Jan 5, 2010 at 11:00 PM, Jacob Kaplan-Moss wrote: > On Tue, Jan 5, 2010 at 7:41 AM, Russell Keith-Magee > wrote: >> I haven't taken the temperature of anyone else in the core, but you >> can take it as read that Simon and myself are both +1. The sprint this >> weekend would be a great opp

Re: idea for using RequestContext by default

2010-01-05 Thread Ben Firshman
On 5 Jan 2010, at 15:00, Jacob Kaplan-Moss wrote: > On Tue, Jan 5, 2010 at 7:41 AM, Russell Keith-Magee > wrote: >> I haven't taken the temperature of anyone else in the core, but you >> can take it as read that Simon and myself are both +1. The sprint >> this >> weekend would be a great oppor

Re: idea for using RequestContext by default

2010-01-05 Thread Jacob Kaplan-Moss
On Tue, Jan 5, 2010 at 7:41 AM, Russell Keith-Magee wrote: > I haven't taken the temperature of anyone else in the core, but you > can take it as read that Simon and myself are both +1. The sprint this > weekend would be a great opportunity to advocate for inclusion of > this. With a few tests and

Re: idea for using RequestContext by default

2010-01-05 Thread Ivan Sagalaev
Russell Keith-Magee wrote: > Certainly - and Simon made exactly this proposal during the review of > the CSRF work. Simon even provided a sample implementation: > > http://groups.google.com/group/django-developers/msg/b1b3f8854b9ae2b1 Thanks! I keep missing nice things on django-dev@ due to many

Re: idea for using RequestContext by default

2010-01-05 Thread Russell Keith-Magee
On Tue, Jan 5, 2010 at 9:23 PM, Ivan Sagalaev wrote: > Russell Keith-Magee wrote: >> I'm in complete agreement with Simon on this point. I fail to see the >> benefit of decorators in this context. > > I can see one valid point that "render_to" guys have. Which is, > incidentally, has nothing to do

Re: idea for using RequestContext by default

2010-01-05 Thread Ivan Sagalaev
Russell Keith-Magee wrote: > I'm in complete agreement with Simon on this point. I fail to see the > benefit of decorators in this context. I can see one valid point that "render_to" guys have. Which is, incidentally, has nothing to do with the decorator syntax. An HttpResponse with an opaque st

Re: idea for using RequestContext by default

2010-01-05 Thread Yuri Baburov
Hi Davor, On Tue, Jan 5, 2010 at 5:06 PM, rebus_ wrote: > Hi, > > This is the "natural" sequence of doing things anyway, i don't see why > would you shuffle it around. > > 1. process stuff into variables > 2. add said variables to a ContextRequest > 3. send said ContextRequest to a template for r

Re: idea for using RequestContext by default

2010-01-05 Thread rebus_
Hi, This is the "natural" sequence of doing things anyway, i don't see why would you shuffle it around. 1. process stuff into variables 2. add said variables to a ContextRequest 3. send said ContextRequest to a template for rendering. In the example buttman gave in his link [1] you could say you

Re: idea for using RequestContext by default

2010-01-04 Thread buttman
> > I much prefer the @render_to() syntax. This way, I can think of my > > view functions as "context variable creators", instead of "response > > returners". I think of view functions as a sort of context processor > > thats only meant for one specific template. > > I'm in complete agreement with

Re: idea for using RequestContext by default

2010-01-04 Thread Russell Keith-Magee
On Tue, Jan 5, 2010 at 1:57 AM, buttman wrote: > On Jan 2, 5:52 pm, Simon Willison wrote: >> On Dec 30 2009, 10:28 pm, Wim Feijen wrote: >> >> > In the discussions on CSRF there have been several proposals to >> > include RequestContext by default in render_to_response or in a >> > similar funct

Re: idea for using RequestContext by default

2010-01-04 Thread buttman
On Jan 2, 5:52 pm, Simon Willison wrote: > On Dec 30 2009, 10:28 pm, Wim Feijen wrote: > > > In the discussions on CSRF there have been several proposals to > > include RequestContext by default in render_to_response or in a > > similar function. As a side note to my previous post, I'd like to >

Re: idea for using RequestContext by default

2010-01-03 Thread Yuri Baburov
Hi Simon, Readability is all about lots of tiny details. I suppose you meant this: def my_view(request, param): return render('my/template.html', {'data': 'some_data'}, request) This decorator intercepts `request` argument. When you have 2 or more ways to return anything from function, it lo

Re: idea for using RequestContext by default

2010-01-02 Thread Simon Willison
On Dec 30 2009, 10:28 pm, Wim Feijen wrote: > In the discussions on CSRF there have been several proposals to > include RequestContext by default in render_to_response or in a > similar function. As a side note to my previous post, I'd like to > mention my favorite way to do this: render_to , see:

Re: idea for using RequestContext by default

2009-12-30 Thread Will LaShell
On Wed, 2009-12-30 at 14:28 -0800, Wim Feijen wrote: > Hello, > > In the discussions on CSRF there have been several proposals to > include RequestContext by default in render_to_response or in a > similar function. As a side note to my previous post, I'd like to > mention my favorite way to do th

idea for using RequestContext by default

2009-12-30 Thread Wim Feijen
Hello, In the discussions on CSRF there have been several proposals to include RequestContext by default in render_to_response or in a similar function. As a side note to my previous post, I'd like to mention my favorite way to do this: render_to , see: http://www.djangosnippets.org/snippets/821/