From f34f1562ffc880078ac8517dcd818f7cc56edff5 Mon Sep 17 00:00:00 2001 From: David Cain Date: Thu, 22 Sep 2022 02:32:26 -0700 Subject: [PATCH 1/4] Remove old deprecation classes for 3.14 release (#8664) When DRF 3.14 is released, these exception classes will be meaningless, so we can delete them (this has always been done). A previous PR removed the last incidence of `RemovedInDRF313Warning`, but didn't outright delete the class for fear of shipping a breaking change: https://github.com/encode/django-rest-framework/pull/8589 --- rest_framework/__init__.py | 8 -------- 1 file changed, 8 deletions(-) diff --git a/rest_framework/__init__.py b/rest_framework/__init__.py index 568e08074..d53b2cb4d 100644 --- a/rest_framework/__init__.py +++ b/rest_framework/__init__.py @@ -29,13 +29,5 @@ if django.VERSION < (3, 2): default_app_config = 'rest_framework.apps.RestFrameworkConfig' -class RemovedInDRF313Warning(DeprecationWarning): - pass - - -class RemovedInDRF314Warning(PendingDeprecationWarning): - pass - - class RemovedInDRF315Warning(PendingDeprecationWarning): pass From eb88dfc4b4df386c6ab42b58ec07c8d97efe554e Mon Sep 17 00:00:00 2001 From: Cihan Eran Date: Thu, 22 Sep 2022 12:36:01 +0300 Subject: [PATCH 2/4] Add --api-version CLI option to generateschema (#8663) * Add --version CLI option to generateschema * fix conflicting argument name --- rest_framework/management/commands/generateschema.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rest_framework/management/commands/generateschema.py b/rest_framework/management/commands/generateschema.py index 024306b65..8c73e4b9c 100644 --- a/rest_framework/management/commands/generateschema.py +++ b/rest_framework/management/commands/generateschema.py @@ -26,6 +26,7 @@ class Command(BaseCommand): parser.add_argument('--urlconf', dest="urlconf", default=None, type=str) parser.add_argument('--generator_class', dest="generator_class", default=None, type=str) parser.add_argument('--file', dest="file", default=None, type=str) + parser.add_argument('--api_version', dest="api_version", default='', type=str) def handle(self, *args, **options): if options['generator_class']: @@ -37,6 +38,7 @@ class Command(BaseCommand): title=options['title'], description=options['description'], urlconf=options['urlconf'], + version=options['api_version'], ) schema = generator.get_schema(request=None, public=True) renderer = self.get_renderer(options['format']) From 058424c16a9625739493843061d72302c8eda57d Mon Sep 17 00:00:00 2001 From: Aaron Taajik <75927372+aaronn44@users.noreply.github.com> Date: Thu, 22 Sep 2022 13:20:23 +0330 Subject: [PATCH 3/4] docs: delete duplicate explanation (#8641) --- docs/api-guide/fields.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/docs/api-guide/fields.md b/docs/api-guide/fields.md index 1e9436213..ab1847c0c 100644 --- a/docs/api-guide/fields.md +++ b/docs/api-guide/fields.md @@ -306,10 +306,6 @@ And to validate numbers up to anything less than one billion with a resolution o serializers.DecimalField(max_digits=19, decimal_places=10) -This field also takes an optional argument, `coerce_to_string`. If set to `True` the representation will be output as a string. If set to `False` the representation will be left as a `Decimal` instance and the final representation will be determined by the renderer. - -If unset, this will default to the same value as the `COERCE_DECIMAL_TO_STRING` setting, which is `True` unless set otherwise. - --- # Date and time fields From 11bfda92bae62382e4f709ba43526f34f090b9df Mon Sep 17 00:00:00 2001 From: Gulshan Ramnath Prajapati <35621580+gulshanAI@users.noreply.github.com> Date: Thu, 22 Sep 2022 15:20:56 +0530 Subject: [PATCH 4/4] both statement have dupplicate bodies (#8633) --- rest_framework/static/rest_framework/docs/js/api.js | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/rest_framework/static/rest_framework/docs/js/api.js b/rest_framework/static/rest_framework/docs/js/api.js index e6120cd8e..21663deb6 100644 --- a/rest_framework/static/rest_framework/docs/js/api.js +++ b/rest_framework/static/rest_framework/docs/js/api.js @@ -131,13 +131,7 @@ $(function () { if (value !== undefined) { params[paramKey] = value } - } else if (dataType === 'array' && paramValue) { - try { - params[paramKey] = JSON.parse(paramValue) - } catch (err) { - // Ignore malformed JSON - } - } else if (dataType === 'object' && paramValue) { + } else if ((dataType === 'array' && paramValue) || (dataType === 'object' && paramValue)) { try { params[paramKey] = JSON.parse(paramValue) } catch (err) {