mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-22 09:36:49 +03:00
More spelling tweaks
This commit is contained in:
parent
dfab9af294
commit
857a8486b1
|
@ -411,7 +411,7 @@ The following class is an example of a generic serializer that can handle coerci
|
|||
# Ignore methods and other callables.
|
||||
pass
|
||||
elif isinstance(attribute, (str, int, bool, float, type(None))):
|
||||
# primitive types can be passed through unmodified.
|
||||
# Primitive types can be passed through unmodified.
|
||||
output[attribute_name] = attribute
|
||||
elif isinstance(attribute, list):
|
||||
# Recursivly deal with items in lists.
|
||||
|
@ -446,7 +446,7 @@ We now use the following:
|
|||
|
||||
#### The `required`, `allow_none`, `allow_blank` and `default` arguments.
|
||||
|
||||
REST framework now has more explict and clear control over validating empty values for fields.
|
||||
REST framework now has more explicit and clear control over validating empty values for fields.
|
||||
|
||||
Previously the meaning of the `required=False` keyword argument was underspecified. In practice its use meant that a field could either be not included in the input, or it could be included, but be `None`.
|
||||
|
||||
|
@ -522,7 +522,7 @@ However this code *would not be valid* in `2.4.3`:
|
|||
# ...
|
||||
|
||||
The queryset argument is now always required for writable relational fields.
|
||||
This removes some magic and makes it easier and more obvious to move between implict `ModelSerializer` classes and explicit `Serializer` classes.
|
||||
This removes some magic and makes it easier and more obvious to move between implicit `ModelSerializer` classes and explicit `Serializer` classes.
|
||||
|
||||
class AccountSerializer(serializers.ModelSerializer):
|
||||
organisations = serializers.SlugRelatedField(
|
||||
|
|
|
@ -148,7 +148,7 @@ class OrderingFilter(BaseFilterBackend):
|
|||
if not getattr(field, 'write_only', False)
|
||||
]
|
||||
elif valid_fields == '__all__':
|
||||
# View explictly allows filtering on any model field
|
||||
# View explicitly allows filtering on any model field
|
||||
valid_fields = [field.name for field in queryset.model._meta.fields]
|
||||
valid_fields += queryset.query.aggregates.keys()
|
||||
|
||||
|
|
|
@ -83,7 +83,7 @@ class DestroyModelMixin(object):
|
|||
|
||||
|
||||
# The AllowPUTAsCreateMixin was previously the default behaviour
|
||||
# for PUT requests. This has now been removed and must be *explictly*
|
||||
# for PUT requests. This has now been removed and must be *explicitly*
|
||||
# included if it is the behavior that you want.
|
||||
# For more info see: ...
|
||||
|
||||
|
|
|
@ -102,7 +102,7 @@ class HyperlinkedRelatedField(RelatedField):
|
|||
|
||||
# We include these simply for dependency injection in tests.
|
||||
# We can't add them as class attributes or they would expect an
|
||||
# implict `self` argument to be passed.
|
||||
# implicit `self` argument to be passed.
|
||||
self.reverse = reverse
|
||||
self.resolve = resolve
|
||||
|
||||
|
|
|
@ -262,9 +262,9 @@ class Issue807Tests(TestCase):
|
|||
expected = "{0}; charset={1}".format(RendererC.media_type, RendererC.charset)
|
||||
self.assertEqual(expected, resp['Content-Type'])
|
||||
|
||||
def test_content_type_set_explictly_on_response(self):
|
||||
def test_content_type_set_explicitly_on_response(self):
|
||||
"""
|
||||
The content type may be set explictly on the response.
|
||||
The content type may be set explicitly on the response.
|
||||
"""
|
||||
headers = {"HTTP_ACCEPT": RendererC.media_type}
|
||||
resp = self.client.get('/setbyview', **headers)
|
||||
|
|
Loading…
Reference in New Issue
Block a user