mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-07-25 23:50:01 +03:00
Merge branch 'master' into dcain-pending-depr-warning
This commit is contained in:
commit
d50faca383
|
@ -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
|
||||
|
|
|
@ -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(DeprecationWarning):
|
||||
pass
|
||||
|
|
|
@ -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'])
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user