On 1 December 2010 13:51, Ivan Sagalaev <man...@softwaremaniacs.org> wrote:
> On 12/01/2010 02:52 PM, Łukasz Rekucki wrote:
>>
>> Lots of people find render_to_response so verbose, that they are using
>> direct_to_template() view instead. Django 1.3 deprecates that one, so
>> it would be fair to offer those people a replacement. Forcing them at
>> the same time into the world of lazy baked responses isn't very fair,
>> imho.
>
> It's not "forcing". TemplateResponse is a transparent replacement for
> HttpResponse. Normal response middleware shouldn't event notice that it's
> working with a TemplateResponse (modulo possible bugs in its
> implementation).

What about view decorators?

I don't want to invent use cases here, but if I right now have a view
decorator that on it's way out changes something that could alter how
a template is rendered (like current language, some settings or the
database contents), then changing to TemplateResponse will break this
view. It's not entirely transparent, because rendering doesn't depend
only on the template and it's context. This adds some complexity to
writing view decorators and I don't know if I want to pay it for a
feature I have no use case atm.

-- 
Łukasz Rekucki

-- 
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