Ticket #9081: flexible_render_to_response.diff
File flexible_render_to_response.diff, 949 bytes (added by , 16 years ago) |
---|
-
django/shortcuts/__init__.py
11 11 12 12 def render_to_response(*args, **kwargs): 13 13 """ 14 Returns a HttpResponse whose content is filled with the result of calling14 Returns a HttpResponse (or subclass) whose content is filled with the result of calling 15 15 django.template.loader.render_to_string() with the passed arguments. 16 16 """ 17 httpresponse_kwargs = {'mimetype': kwargs.pop('mimetype', None)}18 return HttpResponse(loader.render_to_string(*args, **kwargs), **httpresponse_kwargs)17 httpresponse_kwargs, response_class = {'mimetype': kwargs.pop('mimetype', None)}, kwargs.pop('response_class', HttpResponse) 18 return response_class(loader.render_to_string(*args, **kwargs), **httpresponse_kwargs) 19 19 20 20 def _get_queryset(klass): 21 21 """