From 257746785d70c889766f2c6b59382c18e9184bc9 Mon Sep 17 00:00:00 2001 From: Carlton Gibson Date: Mon, 17 Sep 2018 12:07:53 +0200 Subject: [PATCH 01/10] Release notes to 5174a26ec9d50c7b1e934ee2613de4ae2e2c --- docs/community/release-notes.md | 57 ++++++++++++++++++++++++++++++++- 1 file changed, 56 insertions(+), 1 deletion(-) diff --git a/docs/community/release-notes.md b/docs/community/release-notes.md index 700d1d97f..c68188902 100644 --- a/docs/community/release-notes.md +++ b/docs/community/release-notes.md @@ -42,11 +42,39 @@ You can determine your currently installed version using `pip show`: ### 3.9.0 -**Date**: Unreleased +**Date**: [1st October 2018][3.9.0-milestone] + +* Improvements to ViewSet extra actions [#5605][gh5605] * Deprecate the `Router.register` `base_name` argument in favor of `basename`. [#5990][gh5990] * Deprecate the `Router.get_default_base_name` method in favor of `Router.get_default_basename`. [#5990][gh5990] + +* Allow nullable BooleanField in Django 2.1 [#6183][gh6183] +* Add testing of Python 3.7 support [#6141][gh6141] +* Test using Django 2.1 final release. [#6109][gh6109] +* Added djangorestframework-datatables to third-party packages [#5931][gh5931] +* Change ISO 8601 date format to exclude year/month [#5936][gh5936] +* Update all pypi.python.org URLs to pypi.org [#5942][gh5942] +* Ensure that html forms (multipart form data) respect optional fields [#5927][gh5927] +* Allow hashing of ErrorDetail. [#5932][gh5932] +* Correct schema parsing for JSONField [#5878][gh5878] +* Render descriptions (from help_text) using safe [#5869][gh5869] +* Removed input value from deault_error_message [#5881][gh5881] +* Added min_value/max_value support in DurationField [#5643][gh5643] +* Fixed instance being overwritten in pk-only optimization try/except block [#5747][gh5747] +* Fixed AttributeError from items filter when value is None [#5981][gh5981] +* Fixed Javascript `e.indexOf` is not a function error [#5982][gh5982] +* Fix schemas for extra actions [#5992][gh5992] +* Improved get_error_detail to use error_dict/error_list [#5785][gh5785] +* Imprvied URLs in Admin renderer [#5988][gh5988] +* Add "Community" section to docs, minor cleanup [#5993][gh5993] +* Moved guardian imports out of compat [#6054][gh6054] * Deprecate the `DjangoObjectPermissionsFilter` class, moved to the `djangorestframework-guardian` package. [#6075][gh6075] +* Drop Django 1.10 support [#5657][gh5657] +* Only catch TypeError/ValueError for object lookups [#6028][gh6028] +* Handle models without .objects manager in ModelSerializer. [#6111][gh6111] +* Improve ModelSerializer.create() error message. [#6112][gh6112] +* Fix CSRF cookie check failure when using session auth with django 1.11.6+ [#6113][gh6113] ## 3.8.x series @@ -1093,6 +1121,7 @@ For older release notes, [please see the version 2.x documentation][old-release- [3.8.0-milestone]: https://github.com/encode/django-rest-framework/milestone/61?closed=1 [3.8.1-milestone]: https://github.com/encode/django-rest-framework/milestone/67?closed=1 [3.8.2-milestone]: https://github.com/encode/django-rest-framework/milestone/68?closed=1 +[3.9.0-milestone]: https://github.com/encode/django-rest-framework/milestone/66?closed=1 [gh2013]: https://github.com/encode/django-rest-framework/issues/2013 @@ -1974,5 +2003,31 @@ For older release notes, [please see the version 2.x documentation][old-release- [gh5920]: https://github.com/encode/django-rest-framework/issues/5920 +[gh6109]: https://github.com/encode/django-rest-framework/issues/6109 +[gh6141]: https://github.com/encode/django-rest-framework/issues/6141 +[gh6113]: https://github.com/encode/django-rest-framework/issues/6113 +[gh6112]: https://github.com/encode/django-rest-framework/issues/6112 +[gh6111]: https://github.com/encode/django-rest-framework/issues/6111 +[gh6028]: https://github.com/encode/django-rest-framework/issues/6028 +[gh5657]: https://github.com/encode/django-rest-framework/issues/5657 +[gh6054]: https://github.com/encode/django-rest-framework/issues/6054 +[gh5993]: https://github.com/encode/django-rest-framework/issues/5993 [gh5990]: https://github.com/encode/django-rest-framework/issues/5990 +[gh5988]: https://github.com/encode/django-rest-framework/issues/5988 +[gh5785]: https://github.com/encode/django-rest-framework/issues/5785 +[gh5992]: https://github.com/encode/django-rest-framework/issues/5992 +[gh5605]: https://github.com/encode/django-rest-framework/issues/5605 +[gh5982]: https://github.com/encode/django-rest-framework/issues/5982 +[gh5981]: https://github.com/encode/django-rest-framework/issues/5981 +[gh5747]: https://github.com/encode/django-rest-framework/issues/5747 +[gh5643]: https://github.com/encode/django-rest-framework/issues/5643 +[gh5881]: https://github.com/encode/django-rest-framework/issues/5881 +[gh5869]: https://github.com/encode/django-rest-framework/issues/5869 +[gh5878]: https://github.com/encode/django-rest-framework/issues/5878 +[gh5932]: https://github.com/encode/django-rest-framework/issues/5932 +[gh5927]: https://github.com/encode/django-rest-framework/issues/5927 +[gh5942]: https://github.com/encode/django-rest-framework/issues/5942 +[gh5936]: https://github.com/encode/django-rest-framework/issues/5936 +[gh5931]: https://github.com/encode/django-rest-framework/issues/5931 +[gh6183]: https://github.com/encode/django-rest-framework/issues/6183 [gh6075]: https://github.com/encode/django-rest-framework/issues/6075 From 5627d91ee98a88bcc48fdd34c2ba4b1f2cf72b7d Mon Sep 17 00:00:00 2001 From: Carlton Gibson Date: Mon, 17 Sep 2018 12:19:03 +0200 Subject: [PATCH 02/10] Update version for v3.9.0 --- rest_framework/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rest_framework/__init__.py b/rest_framework/__init__.py index fa92ab801..1a9a6527a 100644 --- a/rest_framework/__init__.py +++ b/rest_framework/__init__.py @@ -8,7 +8,7 @@ ______ _____ _____ _____ __ """ __title__ = 'Django REST framework' -__version__ = '3.8.2' +__version__ = '3.9.0' __author__ = 'Tom Christie' __license__ = 'BSD 2-Clause' __copyright__ = 'Copyright 2011-2018 Tom Christie' From 7fb11bf2f50c1a85d551d56b9275295c62907d77 Mon Sep 17 00:00:00 2001 From: Carlton Gibson Date: Tue, 2 Oct 2018 11:42:32 +0200 Subject: [PATCH 03/10] Removed exclude_from_schema per deprecation policy. --- rest_framework/decorators.py | 11 ++-------- rest_framework/schemas/generators.py | 8 ------- tests/test_schemas.py | 32 ---------------------------- 3 files changed, 2 insertions(+), 49 deletions(-) diff --git a/rest_framework/decorators.py b/rest_framework/decorators.py index 2d3bbe46f..6dd769d4c 100644 --- a/rest_framework/decorators.py +++ b/rest_framework/decorators.py @@ -17,7 +17,7 @@ from django.utils import six from rest_framework.views import APIView -def api_view(http_method_names=None, exclude_from_schema=False): +def api_view(http_method_names=None): """ Decorator that converts a function-based view into an APIView subclass. Takes a list of allowed methods for the view as an argument. @@ -77,15 +77,8 @@ def api_view(http_method_names=None, exclude_from_schema=False): WrappedAPIView.schema = getattr(func, 'schema', APIView.schema) - if exclude_from_schema: - warnings.warn( - "The `exclude_from_schema` argument to `api_view` is deprecated. " - "Use the `schema` decorator instead, passing `None`.", - DeprecationWarning - ) - WrappedAPIView.exclude_from_schema = exclude_from_schema - return WrappedAPIView.as_view() + return decorator diff --git a/rest_framework/schemas/generators.py b/rest_framework/schemas/generators.py index 8794c9967..116ca1819 100644 --- a/rest_framework/schemas/generators.py +++ b/rest_framework/schemas/generators.py @@ -207,14 +207,6 @@ class EndpointEnumerator(object): if not is_api_view(callback): return False # Ignore anything except REST framework views. - if hasattr(callback.cls, 'exclude_from_schema'): - fmt = ("The `{}.exclude_from_schema` attribute is deprecated. " - "Set `schema = None` instead.") - msg = fmt.format(callback.cls.__name__) - warnings.warn(msg, DeprecationWarning) - if getattr(callback.cls, 'exclude_from_schema', False): - return False - if callback.cls.schema is None: return False diff --git a/tests/test_schemas.py b/tests/test_schemas.py index ad2e34a4b..8e097f9f4 100644 --- a/tests/test_schemas.py +++ b/tests/test_schemas.py @@ -1032,38 +1032,6 @@ class SchemaGenerationExclusionTests(TestCase): assert should_include == expected - def test_deprecations(self): - with pytest.warns(DeprecationWarning) as record: - @api_view(["GET"], exclude_from_schema=True) - def view(request): - pass - - assert len(record) == 1 - assert str(record[0].message) == ( - "The `exclude_from_schema` argument to `api_view` is deprecated. " - "Use the `schema` decorator instead, passing `None`." - ) - - class OldFashionedExcludedView(APIView): - exclude_from_schema = True - - def get(self, request, *args, **kwargs): - pass - - patterns = [ - url('^excluded-old-fashioned/$', OldFashionedExcludedView.as_view()), - ] - - inspector = EndpointEnumerator(patterns) - with pytest.warns(DeprecationWarning) as record: - inspector.get_api_endpoints() - - assert len(record) == 1 - assert str(record[0].message) == ( - "The `OldFashionedExcludedView.exclude_from_schema` attribute is " - "deprecated. Set `schema = None` instead." - ) - @api_view(["GET"]) def simple_fbv(request): From cfd73825a8eaf32f4de9a73d059db25b2d670e0f Mon Sep 17 00:00:00 2001 From: Carlton Gibson Date: Tue, 2 Oct 2018 11:59:10 +0200 Subject: [PATCH 04/10] Updated list_route() and detail_route() deprecations. --- rest_framework/decorators.py | 8 ++++---- rest_framework/routers.py | 8 ++++---- rest_framework/schemas/generators.py | 1 - tests/test_decorators.py | 10 +++++----- 4 files changed, 13 insertions(+), 14 deletions(-) diff --git a/rest_framework/decorators.py b/rest_framework/decorators.py index 6dd769d4c..f6d557d11 100644 --- a/rest_framework/decorators.py +++ b/rest_framework/decorators.py @@ -223,9 +223,9 @@ def detail_route(methods=None, **kwargs): Used to mark a method on a ViewSet that should be routed for detail requests. """ warnings.warn( - "`detail_route` is pending deprecation and will be removed in 3.10 in favor of " + "`detail_route` is deprecated and will be removed in 3.10 in favor of " "`action`, which accepts a `detail` bool. Use `@action(detail=True)` instead.", - PendingDeprecationWarning, stacklevel=2 + DeprecationWarning, stacklevel=2 ) def decorator(func): @@ -241,9 +241,9 @@ def list_route(methods=None, **kwargs): Used to mark a method on a ViewSet that should be routed for list requests. """ warnings.warn( - "`list_route` is pending deprecation and will be removed in 3.10 in favor of " + "`list_route` is deprecated and will be removed in 3.10 in favor of " "`action`, which accepts a `detail` bool. Use `@action(detail=False)` instead.", - PendingDeprecationWarning, stacklevel=2 + DeprecationWarning, stacklevel=2 ) def decorator(func): diff --git a/rest_framework/routers.py b/rest_framework/routers.py index 392d43f79..db1492c45 100644 --- a/rest_framework/routers.py +++ b/rest_framework/routers.py @@ -40,10 +40,10 @@ DynamicRoute = namedtuple('DynamicRoute', ['url', 'name', 'detail', 'initkwargs' class DynamicDetailRoute(object): def __new__(cls, url, name, initkwargs): warnings.warn( - "`DynamicDetailRoute` is pending deprecation and will be removed in 3.10 " + "`DynamicDetailRoute` is deprecated and will be removed in 3.10 " "in favor of `DynamicRoute`, which accepts a `detail` boolean. Use " "`DynamicRoute(url, name, True, initkwargs)` instead.", - PendingDeprecationWarning, stacklevel=2 + DeprecationWarning, stacklevel=2 ) return DynamicRoute(url, name, True, initkwargs) @@ -51,10 +51,10 @@ class DynamicDetailRoute(object): class DynamicListRoute(object): def __new__(cls, url, name, initkwargs): warnings.warn( - "`DynamicListRoute` is pending deprecation and will be removed in 3.10 in " + "`DynamicListRoute` is deprecated and will be removed in 3.10 in " "favor of `DynamicRoute`, which accepts a `detail` boolean. Use " "`DynamicRoute(url, name, False, initkwargs)` instead.", - PendingDeprecationWarning, stacklevel=2 + DeprecationWarning, stacklevel=2 ) return DynamicRoute(url, name, False, initkwargs) diff --git a/rest_framework/schemas/generators.py b/rest_framework/schemas/generators.py index 116ca1819..c5bda1f1f 100644 --- a/rest_framework/schemas/generators.py +++ b/rest_framework/schemas/generators.py @@ -4,7 +4,6 @@ generators.py # Top-down schema generation See schemas.__init__.py for package overview. """ import re -import warnings from collections import Counter, OrderedDict from importlib import import_module diff --git a/tests/test_decorators.py b/tests/test_decorators.py index 77c488c34..9c6a899bf 100644 --- a/tests/test_decorators.py +++ b/tests/test_decorators.py @@ -290,34 +290,34 @@ class ActionDecoratorTestCase(TestCase): raise NotImplementedError def test_detail_route_deprecation(self): - with pytest.warns(PendingDeprecationWarning) as record: + with pytest.warns(DeprecationWarning) as record: @detail_route() def view(request): raise NotImplementedError assert len(record) == 1 assert str(record[0].message) == ( - "`detail_route` is pending deprecation and will be removed in " + "`detail_route` is deprecated and will be removed in " "3.10 in favor of `action`, which accepts a `detail` bool. Use " "`@action(detail=True)` instead." ) def test_list_route_deprecation(self): - with pytest.warns(PendingDeprecationWarning) as record: + with pytest.warns(DeprecationWarning) as record: @list_route() def view(request): raise NotImplementedError assert len(record) == 1 assert str(record[0].message) == ( - "`list_route` is pending deprecation and will be removed in " + "`list_route` is deprecated and will be removed in " "3.10 in favor of `action`, which accepts a `detail` bool. Use " "`@action(detail=False)` instead." ) def test_route_url_name_from_path(self): # pre-3.8 behavior was to base the `url_name` off of the `url_path` - with pytest.warns(PendingDeprecationWarning): + with pytest.warns(DeprecationWarning): @list_route(url_path='foo_bar') def view(request): raise NotImplementedError From 06d89441a65e64485b5686ec0eec9654c30a97fe Mon Sep 17 00:00:00 2001 From: Carlton Gibson Date: Tue, 2 Oct 2018 12:19:00 +0200 Subject: [PATCH 05/10] Weakened to PendingDeprecationWarning for `base_name` cc @rpkilby. --- rest_framework/routers.py | 6 +++--- tests/test_routers.py | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/rest_framework/routers.py b/rest_framework/routers.py index db1492c45..de04cb674 100644 --- a/rest_framework/routers.py +++ b/rest_framework/routers.py @@ -77,7 +77,7 @@ def flatten(list_of_lists): class RenameRouterMethods(RenameMethodsBase): renamed_methods = ( - ('get_default_base_name', 'get_default_basename', DeprecationWarning), + ('get_default_base_name', 'get_default_basename', PendingDeprecationWarning), ) @@ -87,8 +87,8 @@ class BaseRouter(six.with_metaclass(RenameRouterMethods)): def register(self, prefix, viewset, basename=None, base_name=None): if base_name is not None: - msg = "The `base_name` argument has been deprecated in favor of `basename`." - warnings.warn(msg, DeprecationWarning, 2) + msg = "The `base_name` argument is pending deprecation in favor of `basename`." + warnings.warn(msg, PendingDeprecationWarning, 2) assert not (basename and base_name), ( "Do not provide both the `basename` and `base_name` arguments.") diff --git a/tests/test_routers.py b/tests/test_routers.py index 1dd2d2b0a..eae3f5458 100644 --- a/tests/test_routers.py +++ b/tests/test_routers.py @@ -495,18 +495,18 @@ class TestBaseNameRename(TestCase): warnings.simplefilter('always') router.register('mock', MockViewSet, 'mock', base_name='mock') - msg = "The `base_name` argument has been deprecated in favor of `basename`." + msg = "The `base_name` argument is pending deprecation in favor of `basename`." assert len(w) == 1 assert str(w[0].message) == msg def test_base_name_argument_deprecation(self): router = SimpleRouter() - with warnings.catch_warnings(record=True) as w: + with pytest.warns(PendingDeprecationWarning) as w: warnings.simplefilter('always') router.register('mock', MockViewSet, base_name='mock') - msg = "The `base_name` argument has been deprecated in favor of `basename`." + msg = "The `base_name` argument is pending deprecation in favor of `basename`." assert len(w) == 1 assert str(w[0].message) == msg assert router.registry == [ @@ -529,7 +529,7 @@ class TestBaseNameRename(TestCase): msg = "`CustomRouter.get_default_base_name` method should be renamed `get_default_basename`." # Class definition should raise a warning - with warnings.catch_warnings(record=True) as w: + with pytest.warns(PendingDeprecationWarning) as w: warnings.simplefilter('always') class CustomRouter(SimpleRouter): From 30d6b038157caa3430eb5750bb38901eda97ef4e Mon Sep 17 00:00:00 2001 From: Carlton Gibson Date: Tue, 2 Oct 2018 12:34:51 +0200 Subject: [PATCH 06/10] Add (beginning of) 3.9 release announcement. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @tomchristie: Input on OpenAPI and What’s Next very welcome! :) --- docs/community/3.9-announcement.md | 93 ++++++++++++++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 docs/community/3.9-announcement.md diff --git a/docs/community/3.9-announcement.md b/docs/community/3.9-announcement.md new file mode 100644 index 000000000..35dba16cc --- /dev/null +++ b/docs/community/3.9-announcement.md @@ -0,0 +1,93 @@ + + +# Django REST framework 3.9 + +The 3.9 release gives access to _extra actions_ in the Browsable API, introduces composable permissions and built-in [OpenAPI][openapi] schema support. + +--- + +## Funding + +If you use REST framework commercially and would like to see this work continue, we strongly encourage you to invest in its continued development by +**[signing up for a paid plan][funding]**. + +*We'd like to say thanks in particular our premium backers, [Rover](http://jobs.rover.com/), [Sentry](https://getsentry.com/welcome/), [Stream](https://getstream.io/?utm_source=drf&utm_medium=banner&utm_campaign=drf), [Machinalis](https://hello.machinalis.co.uk/), and [Rollbar](https://rollbar.com).* + +--- + +TODO: HEADLINE FEATURES. 1, 2, 3. + +--- + +## Breaking Changes + +TODO... (NONE???) + +--- + +## Deprecations + +### Router argument/method renamed to use `basename` for consistency. + +* The `Router.register` `base_name` argument has been renamed in favor of `basename`. +* The `Router.get_default_base_name` method has been renamed in favor of `Router.get_default_basename`. [#5990][gh5990] + +See [#5990][gh5990]. + +[gh5990]: https://github.com/encode/django-rest-framework/pull/5990 + +`base_name` and `get_default_base_name()` are pending deprecation. They will be deprecated in 3.10 and removed entirely in 3.11. + +### `action` decorator replaces `list_route` and `detail_route` + +Both `list_route` and `detail_route` are now deprecated in favour of the single `action` decorator. +They will be removed entirely in 3.10. + +The `action` decorator takes a boolean `detail` argument. + +* Replace `detail_route` uses with `@action(detail=True)`. +* Replace `list_route` uses with `@action(detail=False)`. + +### `exclude_from_schema` + +Both `APIView.exclude_from_schema` and the `exclude_from_schema` argument to the `@api_view` have now been removed. + +For `APIView` you should instead set a `schema = None` attribute on the view class. + +For function based views the `@schema` decorator can be used to exclude the view from the schema, by using `@schema(None)`. + +--- + +## Minor fixes and improvements + +There are a large number of minor fixes and improvements in this release. See the [release notes](release-notes.md) page +for a complete listing. + + +## What's next + + +TODO... + + +[funding]: funding.md +[gh5886]: https://github.com/encode/django-rest-framework/issues/5886 +[gh5705]: https://github.com/encode/django-rest-framework/issues/5705 +[openapi]: https://www.openapis.org/ From cc810683d08c7df9e8064d0689fb53a50fa0ccc7 Mon Sep 17 00:00:00 2001 From: Carlton Gibson Date: Tue, 2 Oct 2018 16:00:52 +0200 Subject: [PATCH 07/10] Add announcement section for Extra Actions in Browsable API --- docs/community/3.9-announcement.md | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/docs/community/3.9-announcement.md b/docs/community/3.9-announcement.md index 35dba16cc..846ee4c56 100644 --- a/docs/community/3.9-announcement.md +++ b/docs/community/3.9-announcement.md @@ -28,17 +28,25 @@ The 3.9 release gives access to _extra actions_ in the Browsable API, introduces If you use REST framework commercially and would like to see this work continue, we strongly encourage you to invest in its continued development by **[signing up for a paid plan][funding]**. + +TODO: UPDATE SPONSORS. + *We'd like to say thanks in particular our premium backers, [Rover](http://jobs.rover.com/), [Sentry](https://getsentry.com/welcome/), [Stream](https://getstream.io/?utm_source=drf&utm_medium=banner&utm_campaign=drf), [Machinalis](https://hello.machinalis.co.uk/), and [Rollbar](https://rollbar.com).* --- -TODO: HEADLINE FEATURES. 1, 2, 3. +## ViewSet _Extra Actions_ available in the Browsable API ---- +Following the introduction of the `action` decorator in v3.8, _extra actions_ defined on a ViewSet are now available +from the Browsable API. -## Breaking Changes +![Extra Actions displayed in the Browsable API](https://user-images.githubusercontent.com/2370209/32976956-1ca9ab7e-cbf1-11e7-981a-a20cb1e83d63.png) -TODO... (NONE???) +When defined, a dropdown of "Extra Actions", appropriately filtered to detail/non-detail actions, is displayed. + +## In-built OpenAPI schema support + +TODO --- From b49980471fc9370d50b318f9a03bb9f4d1aa684d Mon Sep 17 00:00:00 2001 From: Carlton Gibson Date: Tue, 2 Oct 2018 16:46:45 +0200 Subject: [PATCH 08/10] Update release notes and add deprecation note for Django Guardian backend. --- docs/community/3.9-announcement.md | 7 +++++++ docs/community/release-notes.md | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/docs/community/3.9-announcement.md b/docs/community/3.9-announcement.md index 846ee4c56..e1c641780 100644 --- a/docs/community/3.9-announcement.md +++ b/docs/community/3.9-announcement.md @@ -52,6 +52,13 @@ TODO ## Deprecations +### `DjangoObjectPermissionsFilter` moved to third-party package. + +The `DjangoObjectPermissionsFilter` class is pending deprecation, will be deprecated in 3.10 and removed entirely in 3.11. + +It has been moved to the third-party [`djangorestframework-guardian`](https://github.com/rpkilby/django-rest-framework-guardian) +package. Please use this instead. + ### Router argument/method renamed to use `basename` for consistency. * The `Router.register` `base_name` argument has been renamed in favor of `basename`. diff --git a/docs/community/release-notes.md b/docs/community/release-notes.md index c68188902..316226cfd 100644 --- a/docs/community/release-notes.md +++ b/docs/community/release-notes.md @@ -46,6 +46,7 @@ You can determine your currently installed version using `pip show`: * Improvements to ViewSet extra actions [#5605][gh5605] +* Fix action support for ViewSet suffixes [#6081][gh6081] * Deprecate the `Router.register` `base_name` argument in favor of `basename`. [#5990][gh5990] * Deprecate the `Router.get_default_base_name` method in favor of `Router.get_default_basename`. [#5990][gh5990] @@ -75,6 +76,7 @@ You can determine your currently installed version using `pip show`: * Handle models without .objects manager in ModelSerializer. [#6111][gh6111] * Improve ModelSerializer.create() error message. [#6112][gh6112] * Fix CSRF cookie check failure when using session auth with django 1.11.6+ [#6113][gh6113] +* Updated JWT docs. [#6138][gh6138] ## 3.8.x series @@ -2031,3 +2033,5 @@ For older release notes, [please see the version 2.x documentation][old-release- [gh5931]: https://github.com/encode/django-rest-framework/issues/5931 [gh6183]: https://github.com/encode/django-rest-framework/issues/6183 [gh6075]: https://github.com/encode/django-rest-framework/issues/6075 +[gh6138]: https://github.com/encode/django-rest-framework/issues/6138 +[gh6081]: https://github.com/encode/django-rest-framework/issues/6081 From b3d0bb126d76a96dcc51c5649ba04ea07816f578 Mon Sep 17 00:00:00 2001 From: Carlton Gibson Date: Tue, 2 Oct 2018 16:57:30 +0200 Subject: [PATCH 09/10] Add release note for #6073 --- docs/community/release-notes.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/docs/community/release-notes.md b/docs/community/release-notes.md index 316226cfd..371a16236 100644 --- a/docs/community/release-notes.md +++ b/docs/community/release-notes.md @@ -44,11 +44,18 @@ You can determine your currently installed version using `pip show`: **Date**: [1st October 2018][3.9.0-milestone] - * Improvements to ViewSet extra actions [#5605][gh5605] * Fix action support for ViewSet suffixes [#6081][gh6081] * Deprecate the `Router.register` `base_name` argument in favor of `basename`. [#5990][gh5990] * Deprecate the `Router.get_default_base_name` method in favor of `Router.get_default_basename`. [#5990][gh5990] +* Change `CharField` to disallow null bytes. [#6073][gh6073] + To revert to the old behavior, subclass `CharField` and remove `ProhibitNullCharactersValidator` from the validators. + ```python + class NullableCharField(serializers.CharField): + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) + self.validators = [v for v in self.validators if not isinstance(v, ProhibitNullCharactersValidator)] + ``` * Allow nullable BooleanField in Django 2.1 [#6183][gh6183] * Add testing of Python 3.7 support [#6141][gh6141] @@ -2035,3 +2042,4 @@ For older release notes, [please see the version 2.x documentation][old-release- [gh6075]: https://github.com/encode/django-rest-framework/issues/6075 [gh6138]: https://github.com/encode/django-rest-framework/issues/6138 [gh6081]: https://github.com/encode/django-rest-framework/issues/6081 +[gh6073]: https://github.com/encode/django-rest-framework/issues/6073 From 56101ac33cb3bd86fc0ac4039b3cd6d382e253a6 Mon Sep 17 00:00:00 2001 From: Carlton Gibson Date: Wed, 10 Oct 2018 10:49:12 +0200 Subject: [PATCH 10/10] Add release notes to dd19a44583e30bdb325da23583f2a934399155e1 --- docs/community/release-notes.md | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/docs/community/release-notes.md b/docs/community/release-notes.md index 371a16236..09b2d0ee5 100644 --- a/docs/community/release-notes.md +++ b/docs/community/release-notes.md @@ -45,7 +45,8 @@ You can determine your currently installed version using `pip show`: **Date**: [1st October 2018][3.9.0-milestone] * Improvements to ViewSet extra actions [#5605][gh5605] -* Fix action support for ViewSet suffixes [#6081][gh6081] +* Fix `action` support for ViewSet suffixes [#6081][gh6081] +* Allow `action` docs sections [#6060][gh6060] * Deprecate the `Router.register` `base_name` argument in favor of `basename`. [#5990][gh5990] * Deprecate the `Router.get_default_base_name` method in favor of `Router.get_default_basename`. [#5990][gh5990] * Change `CharField` to disallow null bytes. [#6073][gh6073] @@ -56,7 +57,9 @@ You can determine your currently installed version using `pip show`: super().__init__(*args, **kwargs) self.validators = [v for v in self.validators if not isinstance(v, ProhibitNullCharactersValidator)] ``` - +* Add `OpenAPIRenderer` and `generate_schema` management command. [#6229][gh6229] +* Add OpenAPIRenderer by default, and add schema docs. [#6233][gh6233] +* Allow permissions to be composed [#5753][gh5753] * Allow nullable BooleanField in Django 2.1 [#6183][gh6183] * Add testing of Python 3.7 support [#6141][gh6141] * Test using Django 2.1 final release. [#6109][gh6109] @@ -84,6 +87,7 @@ You can determine your currently installed version using `pip show`: * Improve ModelSerializer.create() error message. [#6112][gh6112] * Fix CSRF cookie check failure when using session auth with django 1.11.6+ [#6113][gh6113] * Updated JWT docs. [#6138][gh6138] +* Fix autoescape not getting passed to urlize_quoted_links filter [#6191][gh6191] ## 3.8.x series @@ -2043,3 +2047,8 @@ For older release notes, [please see the version 2.x documentation][old-release- [gh6138]: https://github.com/encode/django-rest-framework/issues/6138 [gh6081]: https://github.com/encode/django-rest-framework/issues/6081 [gh6073]: https://github.com/encode/django-rest-framework/issues/6073 +[gh6191]: https://github.com/encode/django-rest-framework/issues/6191 +[gh6060]: https://github.com/encode/django-rest-framework/issues/6060 +[gh6233]: https://github.com/encode/django-rest-framework/issues/6233 +[gh5753]: https://github.com/encode/django-rest-framework/issues/5753 +[gh6229]: https://github.com/encode/django-rest-framework/issues/6229