Skip to content

Commit

Permalink
[DATALAD RUNCMD] run codespell throughout fixing typo automagically
Browse files Browse the repository at this point in the history
=== Do not change lines below ===
{
 "chain": [],
 "cmd": "codespell -w",
 "exit": 0,
 "extra_inputs": [],
 "inputs": [],
 "outputs": [],
 "pwd": "."
}
^^^ Do not change lines above ^^^
  • Loading branch information
yarikoptic committed Jan 24, 2024
1 parent dc0d556 commit 4c65e32
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion docs/api-guide/fields.md
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ Corresponds to `django.db.models.fields.DecimalField`.
* `min_value` Validate that the number provided is no less than this value.
* `localize` Set to `True` to enable localization of input and output based on the current locale. This will also force `coerce_to_string` to `True`. Defaults to `False`. Note that data formatting is enabled if you have set `USE_L10N=True` in your settings file.
* `rounding` Sets the rounding mode used when quantizing to the configured precision. Valid values are [`decimal` module rounding modes][python-decimal-rounding-modes]. Defaults to `None`.
* `normalize_output` Will normalize the decimal value when serialized. This will strip all trailing zeroes and change the value's precision to the minimum required precision to be able to represent the value without loosing data. Defaults to `False`.
* `normalize_output` Will normalize the decimal value when serialized. This will strip all trailing zeroes and change the value's precision to the minimum required precision to be able to represent the value without losing data. Defaults to `False`.

#### Example usage

Expand Down
2 changes: 1 addition & 1 deletion docs/topics/internationalization.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ REST framework includes these built-in translations both for standard exception

Note that the translations only apply to the error strings themselves. The format of error messages, and the keys of field names will remain the same. An example `400 Bad Request` response body might look like this:

{"detail": {"username": ["Esse campo deve ser único."]}}
{"detail": {"username": ["Esse campo deve set único."]}}

If you want to use different string for parts of the response such as `detail` and `non_field_errors` then you can modify this behavior by using a [custom exception handler][custom-exception-handler].

Expand Down
4 changes: 2 additions & 2 deletions rest_framework/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@


def search_smart_split(search_terms):
"""generator that first splits string by spaces, leaving quoted phrases togheter,
"""generator that first splits string by spaces, leaving quoted phrases together,
then it splits non-quoted phrases by commas.
"""
for term in smart_split(search_terms):
# trim commas to avoid bad matching for quoted phrases
term = term.strip(',')
if term.startswith(('"', "'")) and term[0] == term[-1]:
# quoted phrases are kept togheter without any other split
# quoted phrases are kept together without any other split
yield unescape_string_literal(term)
else:
# non-quoted tokens are split by comma, keeping only non-empty ones
Expand Down
4 changes: 2 additions & 2 deletions rest_framework/schemas/generators.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,12 @@ def get_path_from_regex(self, path_regex):
Given a URL conf regex, return a URI template string.
"""
# ???: Would it be feasible to adjust this such that we generate the
# path, plus the kwargs, plus the type from the convertor, such that we
# path, plus the kwargs, plus the type from the converter, such that we
# could feed that straight into the parameter schema object?

path = simplify_regex(path_regex)

# Strip Django 2.0 convertors as they are incompatible with uritemplate format
# Strip Django 2.0 converters as they are incompatible with uritemplate format
return re.sub(_PATH_PARAMETER_COMPONENT_RE, r'{\g<parameter>}', path)

def should_include_endpoint(self, path, callback):
Expand Down
2 changes: 1 addition & 1 deletion rest_framework/schemas/openapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def get_schema(self, request=None, public=False):
continue
if components_schemas[k] == components[k]:
continue
warnings.warn('Schema component "{}" has been overriden with a different value.'.format(k))
warnings.warn('Schema component "{}" has been overridden with a different value.'.format(k))

components_schemas.update(components)

Expand Down
2 changes: 1 addition & 1 deletion rest_framework/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
'COERCE_DECIMAL_TO_STRING': True,
'UPLOADED_FILES_USE_URL': True,

# Browseable API
# Browsable API
'HTML_SELECT_CUTOFF': 1000,
'HTML_SELECT_CUTOFF_TEXT': "More than {count} items...",

Expand Down
2 changes: 1 addition & 1 deletion tests/schemas/test_openapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -1347,7 +1347,7 @@ def test_duplicate_component_name(self):

assert len(w) == 1
assert issubclass(w[-1].category, UserWarning)
assert 'has been overriden with a different value.' in str(w[-1].message)
assert 'has been overridden with a different value.' in str(w[-1].message)

assert 'components' in schema
assert 'schemas' in schema['components']
Expand Down
2 changes: 1 addition & 1 deletion tests/test_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ class HTMLNewModelView(generics.ListCreateAPIView):
]


# TODO: Clean tests bellow - remove duplicates with above, better unit testing, ...
# TODO: Clean tests below - remove duplicates with above, better unit testing, ...
@override_settings(ROOT_URLCONF='tests.test_response')
class RendererIntegrationTests(TestCase):
"""
Expand Down
4 changes: 2 additions & 2 deletions tests/test_serializer_nested.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ def test_json_validate(self):
input_data = {}
serializer = self.Serializer(data=input_data)

# request is empty, therefor 'nested' should not be in serializer.data
# request is empty, therefore 'nested' should not be in serializer.data
assert serializer.is_valid()
assert 'nested' not in serializer.validated_data

Expand All @@ -237,7 +237,7 @@ def test_multipart_validate(self):
input_data = QueryDict('')
serializer = self.Serializer(data=input_data)

# the querydict is empty, therefor 'nested' should not be in serializer.data
# the querydict is empty, therefore 'nested' should not be in serializer.data
assert serializer.is_valid()
assert 'nested' not in serializer.validated_data

Expand Down

0 comments on commit 4c65e32

Please sign in to comment.