mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-02-07 07:00:54 +03:00
parent
35320b1f2d
commit
bb613c5ad1
|
@ -40,6 +40,12 @@ You can determine your currently installed version using `pip freeze`:
|
||||||
|
|
||||||
## 3.4.x series
|
## 3.4.x series
|
||||||
|
|
||||||
|
### 3.4.3
|
||||||
|
|
||||||
|
**Date**: [5th August 2016][3.4.3-milestone]
|
||||||
|
|
||||||
|
* Include fallaback for users of older TemplateHTMLRenderer internal API. ([#4361][gh4361])
|
||||||
|
|
||||||
### 3.4.2
|
### 3.4.2
|
||||||
|
|
||||||
**Date**: [5th August 2016][3.4.2-milestone]
|
**Date**: [5th August 2016][3.4.2-milestone]
|
||||||
|
@ -533,6 +539,7 @@ For older release notes, [please see the version 2.x documentation][old-release-
|
||||||
[3.4.0-milestone]: https://github.com/tomchristie/django-rest-framework/issues?q=milestone%3A%223.4.0+Release%22
|
[3.4.0-milestone]: https://github.com/tomchristie/django-rest-framework/issues?q=milestone%3A%223.4.0+Release%22
|
||||||
[3.4.1-milestone]: https://github.com/tomchristie/django-rest-framework/issues?q=milestone%3A%223.4.1+Release%22
|
[3.4.1-milestone]: https://github.com/tomchristie/django-rest-framework/issues?q=milestone%3A%223.4.1+Release%22
|
||||||
[3.4.2-milestone]: https://github.com/tomchristie/django-rest-framework/issues?q=milestone%3A%223.4.2+Release%22
|
[3.4.2-milestone]: https://github.com/tomchristie/django-rest-framework/issues?q=milestone%3A%223.4.2+Release%22
|
||||||
|
[3.4.3-milestone]: https://github.com/tomchristie/django-rest-framework/issues?q=milestone%3A%223.4.3+Release%22
|
||||||
|
|
||||||
<!-- 3.0.1 -->
|
<!-- 3.0.1 -->
|
||||||
[gh2013]: https://github.com/tomchristie/django-rest-framework/issues/2013
|
[gh2013]: https://github.com/tomchristie/django-rest-framework/issues/2013
|
||||||
|
@ -990,3 +997,6 @@ For older release notes, [please see the version 2.x documentation][old-release-
|
||||||
[gh4357]: https://github.com/tomchristie/django-rest-framework/issues/4357
|
[gh4357]: https://github.com/tomchristie/django-rest-framework/issues/4357
|
||||||
[gh4358]: https://github.com/tomchristie/django-rest-framework/issues/4358
|
[gh4358]: https://github.com/tomchristie/django-rest-framework/issues/4358
|
||||||
[gh4359]: https://github.com/tomchristie/django-rest-framework/issues/4359
|
[gh4359]: https://github.com/tomchristie/django-rest-framework/issues/4359
|
||||||
|
|
||||||
|
<!-- 3.4.3 -->
|
||||||
|
[gh4361]: https://github.com/tomchristie/django-rest-framework/issues/4361
|
||||||
|
|
|
@ -8,7 +8,7 @@ ______ _____ _____ _____ __
|
||||||
"""
|
"""
|
||||||
|
|
||||||
__title__ = 'Django REST framework'
|
__title__ = 'Django REST framework'
|
||||||
__version__ = '3.4.2'
|
__version__ = '3.4.3'
|
||||||
__author__ = 'Tom Christie'
|
__author__ = 'Tom Christie'
|
||||||
__license__ = 'BSD 2-Clause'
|
__license__ = 'BSD 2-Clause'
|
||||||
__copyright__ = 'Copyright 2011-2016 Tom Christie'
|
__copyright__ = 'Copyright 2011-2016 Tom Christie'
|
||||||
|
|
|
@ -166,6 +166,10 @@ class TemplateHTMLRenderer(BaseRenderer):
|
||||||
template_names = self.get_template_names(response, view)
|
template_names = self.get_template_names(response, view)
|
||||||
template = self.resolve_template(template_names)
|
template = self.resolve_template(template_names)
|
||||||
|
|
||||||
|
if hasattr(self, 'resolve_context'):
|
||||||
|
# Fallback for older versions.
|
||||||
|
context = self.resolve_context(self, data, request, response)
|
||||||
|
else:
|
||||||
context = self.get_template_context(data, renderer_context)
|
context = self.get_template_context(data, renderer_context)
|
||||||
return template_render(template, context, request=request)
|
return template_render(template, context, request=request)
|
||||||
|
|
||||||
|
@ -229,7 +233,10 @@ class StaticHTMLRenderer(TemplateHTMLRenderer):
|
||||||
if response and response.exception:
|
if response and response.exception:
|
||||||
request = renderer_context['request']
|
request = renderer_context['request']
|
||||||
template = self.get_exception_template(response)
|
template = self.get_exception_template(response)
|
||||||
|
if hasattr(self, 'resolve_context'):
|
||||||
context = self.resolve_context(data, request, response)
|
context = self.resolve_context(data, request, response)
|
||||||
|
else:
|
||||||
|
context = self.get_template_context(data, renderer_context)
|
||||||
return template_render(template, context, request=request)
|
return template_render(template, context, request=request)
|
||||||
|
|
||||||
return data
|
return data
|
||||||
|
|
Loading…
Reference in New Issue
Block a user