mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-06 05:20:12 +03:00
remove '# allows subclasses to change defaults' comments
This commit is contained in:
parent
ae48939c33
commit
4881126544
|
@ -563,7 +563,6 @@ class CharField(Field):
|
||||||
'min_length': _('Ensure this field has at least {min_length} characters.')
|
'min_length': _('Ensure this field has at least {min_length} characters.')
|
||||||
}
|
}
|
||||||
initial = ''
|
initial = ''
|
||||||
# allows subclasses to change defaults
|
|
||||||
allow_blank = False
|
allow_blank = False
|
||||||
max_length = None
|
max_length = None
|
||||||
min_length = None
|
min_length = None
|
||||||
|
@ -658,7 +657,6 @@ class IntegerField(Field):
|
||||||
'max_string_length': _('String value too large')
|
'max_string_length': _('String value too large')
|
||||||
}
|
}
|
||||||
MAX_STRING_LENGTH = 1000 # Guard against malicious string inputs.
|
MAX_STRING_LENGTH = 1000 # Guard against malicious string inputs.
|
||||||
# allows subclasses to change defaults
|
|
||||||
max_value = None
|
max_value = None
|
||||||
min_value = None
|
min_value = None
|
||||||
|
|
||||||
|
@ -695,7 +693,6 @@ class FloatField(Field):
|
||||||
'max_string_length': _('String value too large')
|
'max_string_length': _('String value too large')
|
||||||
}
|
}
|
||||||
MAX_STRING_LENGTH = 1000 # Guard against malicious string inputs.
|
MAX_STRING_LENGTH = 1000 # Guard against malicious string inputs.
|
||||||
# allows subclasses to change defaults
|
|
||||||
max_value = None
|
max_value = None
|
||||||
min_value = None
|
min_value = None
|
||||||
|
|
||||||
|
@ -734,7 +731,6 @@ class DecimalField(Field):
|
||||||
'max_string_length': _('String value too large')
|
'max_string_length': _('String value too large')
|
||||||
}
|
}
|
||||||
MAX_STRING_LENGTH = 1000 # Guard against malicious string inputs.
|
MAX_STRING_LENGTH = 1000 # Guard against malicious string inputs.
|
||||||
# allows subclasses to change defaults
|
|
||||||
max_value = None
|
max_value = None
|
||||||
min_value = None
|
min_value = None
|
||||||
# todo: max_digits = None
|
# todo: max_digits = None
|
||||||
|
@ -824,7 +820,6 @@ class DateTimeField(Field):
|
||||||
'invalid': _('Datetime has wrong format. Use one of these formats instead: {format}'),
|
'invalid': _('Datetime has wrong format. Use one of these formats instead: {format}'),
|
||||||
'date': _('Expected a datetime but got a date.'),
|
'date': _('Expected a datetime but got a date.'),
|
||||||
}
|
}
|
||||||
# allows subclasses to change defaults
|
|
||||||
format = api_settings.DATETIME_FORMAT
|
format = api_settings.DATETIME_FORMAT
|
||||||
input_formats = api_settings.DATETIME_INPUT_FORMATS
|
input_formats = api_settings.DATETIME_INPUT_FORMATS
|
||||||
default_timezone = timezone.get_default_timezone() if settings.USE_TZ else None
|
default_timezone = timezone.get_default_timezone() if settings.USE_TZ else None
|
||||||
|
@ -890,7 +885,6 @@ class DateField(Field):
|
||||||
'invalid': _('Date has wrong format. Use one of these formats instead: {format}'),
|
'invalid': _('Date has wrong format. Use one of these formats instead: {format}'),
|
||||||
'datetime': _('Expected a date but got a datetime.'),
|
'datetime': _('Expected a date but got a datetime.'),
|
||||||
}
|
}
|
||||||
# allows subclasses to change defaults
|
|
||||||
format = api_settings.DATE_FORMAT
|
format = api_settings.DATE_FORMAT
|
||||||
input_formats = api_settings.DATE_INPUT_FORMATS
|
input_formats = api_settings.DATE_INPUT_FORMATS
|
||||||
|
|
||||||
|
@ -948,7 +942,6 @@ class TimeField(Field):
|
||||||
default_error_messages = {
|
default_error_messages = {
|
||||||
'invalid': _('Time has wrong format. Use one of these formats instead: {format}'),
|
'invalid': _('Time has wrong format. Use one of these formats instead: {format}'),
|
||||||
}
|
}
|
||||||
# allows subclasses to change defaults
|
|
||||||
format = api_settings.TIME_FORMAT
|
format = api_settings.TIME_FORMAT
|
||||||
input_formats = api_settings.TIME_INPUT_FORMATS
|
input_formats = api_settings.TIME_INPUT_FORMATS
|
||||||
|
|
||||||
|
@ -1005,7 +998,6 @@ class ChoiceField(Field):
|
||||||
default_error_messages = {
|
default_error_messages = {
|
||||||
'invalid_choice': _('`{input}` is not a valid choice.')
|
'invalid_choice': _('`{input}` is not a valid choice.')
|
||||||
}
|
}
|
||||||
# allows subclasses to change defaults
|
|
||||||
allow_blank = False
|
allow_blank = False
|
||||||
choices = None
|
choices = None
|
||||||
|
|
||||||
|
@ -1094,7 +1086,6 @@ class FileField(Field):
|
||||||
'empty': _("The submitted file is empty."),
|
'empty': _("The submitted file is empty."),
|
||||||
'max_length': _('Ensure this filename has at most {max_length} characters (it has {length}).'),
|
'max_length': _('Ensure this filename has at most {max_length} characters (it has {length}).'),
|
||||||
}
|
}
|
||||||
# allows subclasses to change defaults
|
|
||||||
use_url = api_settings.UPLOADED_FILES_USE_URL
|
use_url = api_settings.UPLOADED_FILES_USE_URL
|
||||||
max_length = None
|
max_length = None
|
||||||
allow_empty_file = False
|
allow_empty_file = False
|
||||||
|
@ -1296,7 +1287,6 @@ class ModelField(Field):
|
||||||
default_error_messages = {
|
default_error_messages = {
|
||||||
'max_length': _('Ensure this field has no more than {max_length} characters.'),
|
'max_length': _('Ensure this field has no more than {max_length} characters.'),
|
||||||
}
|
}
|
||||||
# allows subclasses to change defaults
|
|
||||||
max_length = None
|
max_length = None
|
||||||
|
|
||||||
def __init__(self, model_field, **kwargs):
|
def __init__(self, model_field, **kwargs):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user