On 10/20/2010 11:51 PM, Mikhail Korobov wrote:
#12815 is about introducing TemplateResponse. Is the patch with
'render' shortcut returning just HttpResponse acceptable? I think that
TemplateResponse is less useful after class-based views make their way
into trunk so 'render' shortcut shouldn't bother returning
TemplateResponse. There are ways to reuse view logic (and change view
context in particular) now and TemplateResponse (which was a good
addition to django 1.2/1.1/1.0) seems to only complicate things in
django 1.3.

Wait!!!

Sorry… Hello everyone :-)

If I remember correctly TemplateResponse was solving a problem of some middleware wanting to mess with a view context before it's baked into final string representation. This would solve in a good way what now is accomplished by things like @render_to decorator.

What I don't understand from your reasoning is how class-based views are going to help here? From what I see only Django-supplied generic views are now class-based and we didn't deprecate simple user view functions. Which means that "render" won't be as useful for them if it wouldn't provide any means to post-process the context and if the context won't be aware of request: these are two main points why people are not happy with render_to_response right now.

Mikhail, do you have any actual objections against TemplateResponse or you just don't want to complicate your implementation? If it is the latter then TemplateResponse has been already implemented[1] by Simon Willison. You might just use it.

[1]: http://github.com/simonw/django-openid/blob/master/django_openid/response.py

--
You received this message because you are subscribed to the Google Groups "Django 
developers" group.
To post to this group, send email to django-develop...@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.

Reply via email to