mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-25 19:14:01 +03:00
Fix typos (#6835)
This commit is contained in:
parent
ca727872c8
commit
0e1c5d3132
|
@ -324,7 +324,7 @@ If the `.authenticate_header()` method is not overridden, the authentication sch
|
|||
|
||||
---
|
||||
|
||||
**Note:** When your custom authenticator is invoked by the request object's `.user` or `.auth` properties, you may see an `AttributeError` re-raised as a `WrappedAttributeError`. This is necessary to prevent the original exception from being suppressed by the outer property access. Python will not recognize that the `AttributeError` orginates from your custom authenticator and will instead assume that the request object does not have a `.user` or `.auth` property. These errors should be fixed or otherwise handled by your authenticator.
|
||||
**Note:** When your custom authenticator is invoked by the request object's `.user` or `.auth` properties, you may see an `AttributeError` re-raised as a `WrappedAttributeError`. This is necessary to prevent the original exception from being suppressed by the outer property access. Python will not recognize that the `AttributeError` originates from your custom authenticator and will instead assume that the request object does not have a `.user` or `.auth` property. These errors should be fixed or otherwise handled by your authenticator.
|
||||
|
||||
---
|
||||
|
||||
|
|
|
@ -286,7 +286,7 @@ The following third party packages are also available.
|
|||
|
||||
## DRF - Access Policy
|
||||
|
||||
The [Django REST - Access Policy][drf-access-policy] package provides a way to define complex access rules in declaritive policy classes that are attached to view sets or function-based views. The policies are defined in JSON in a format similar to AWS' Identity & Access Management policies.
|
||||
The [Django REST - Access Policy][drf-access-policy] package provides a way to define complex access rules in declarative policy classes that are attached to view sets or function-based views. The policies are defined in JSON in a format similar to AWS' Identity & Access Management policies.
|
||||
|
||||
## Composed Permissions
|
||||
|
||||
|
|
|
@ -93,7 +93,7 @@ You won't typically need to access this property.
|
|||
|
||||
---
|
||||
|
||||
**Note:** You may see a `WrappedAttributeError` raised when calling the `.user` or `.auth` properties. These errors originate from an authenticator as a standard `AttributeError`, however it's necessary that they be re-raised as a different exception type in order to prevent them from being suppressed by the outer property access. Python will not recognize that the `AttributeError` orginates from the authenticator and will instead assume that the request object does not have a `.user` or `.auth` property. The authenticator will need to be fixed.
|
||||
**Note:** You may see a `WrappedAttributeError` raised when calling the `.user` or `.auth` properties. These errors originate from an authenticator as a standard `AttributeError`, however it's necessary that they be re-raised as a different exception type in order to prevent them from being suppressed by the outer property access. Python will not recognize that the `AttributeError` originates from the authenticator and will instead assume that the request object does not have a `.user` or `.auth` property. The authenticator will need to be fixed.
|
||||
|
||||
---
|
||||
|
||||
|
|
|
@ -480,7 +480,7 @@ An `APIView`, with an explicit method docstring.
|
|||
usernames = [user.username for user in User.objects.all()]
|
||||
return Response(usernames)
|
||||
|
||||
A `ViewSet`, with an explict action docstring.
|
||||
A `ViewSet`, with an explicit action docstring.
|
||||
|
||||
class ListUsernames(ViewSet):
|
||||
def list(self, request):
|
||||
|
|
|
@ -12,7 +12,7 @@ There are also a number of great third-party documentation packages available.
|
|||
## Generating documentation from OpenAPI schemas
|
||||
|
||||
There are a number of packages available that allow you to generate HTML
|
||||
documenation pages from OpenAPI schemas.
|
||||
documentation pages from OpenAPI schemas.
|
||||
|
||||
Two popular options are [Swagger UI][swagger-ui] and [ReDoc][redoc].
|
||||
|
||||
|
|
|
@ -976,7 +976,7 @@ class ModelSerializer(Serializer):
|
|||
instance.save()
|
||||
|
||||
# Note that many-to-many fields are set after updating instance.
|
||||
# Setting m2m fields triggers signals which could potentialy change
|
||||
# Setting m2m fields triggers signals which could potentially change
|
||||
# updated instance and we do not want it to collide with .update()
|
||||
for attr, value in m2m_fields:
|
||||
field = getattr(instance, attr)
|
||||
|
|
|
@ -233,7 +233,7 @@ def format_value(value):
|
|||
def items(value):
|
||||
"""
|
||||
Simple filter to return the items of the dict. Useful when the dict may
|
||||
have a key 'items' which is resolved first in Django tempalte dot-notation
|
||||
have a key 'items' which is resolved first in Django template dot-notation
|
||||
lookup. See issue #4931
|
||||
Also see: https://stackoverflow.com/questions/15416662/django-template-loop-over-dictionary-items-with-items-as-key
|
||||
"""
|
||||
|
|
|
@ -53,7 +53,7 @@ class ViewSetMixin:
|
|||
and slightly modify the view function that is created and returned.
|
||||
"""
|
||||
# The name and description initkwargs may be explicitly overridden for
|
||||
# certain route confiugurations. eg, names of extra actions.
|
||||
# certain route configurations. eg, names of extra actions.
|
||||
cls.name = None
|
||||
cls.description = None
|
||||
|
||||
|
|
|
@ -303,7 +303,7 @@ class TestRegularFieldMappings(TestCase):
|
|||
def test_invalid_field(self):
|
||||
"""
|
||||
Field names that do not map to a model field or relationship should
|
||||
raise a configuration errror.
|
||||
raise a configuration error.
|
||||
"""
|
||||
class TestSerializer(serializers.ModelSerializer):
|
||||
class Meta:
|
||||
|
|
|
@ -540,7 +540,7 @@ class SchemaLinksTests(TestCase):
|
|||
]
|
||||
),
|
||||
'create': coreapi.Link(
|
||||
url='/aniamls/cat',
|
||||
url='/animals/cat',
|
||||
action='post',
|
||||
fields=[]
|
||||
)
|
||||
|
@ -589,7 +589,7 @@ class SchemaLinksTests(TestCase):
|
|||
]
|
||||
),
|
||||
'create': coreapi.Link(
|
||||
url='/aniamls/cat',
|
||||
url='/animals/cat',
|
||||
action='post',
|
||||
fields=[]
|
||||
)
|
||||
|
|
|
@ -174,7 +174,7 @@ class BreadcrumbTests(TestCase):
|
|||
|
||||
class JsonFloatTests(TestCase):
|
||||
"""
|
||||
Internaly, wrapped json functions should adhere to strict float handling
|
||||
Internally, wrapped json functions should adhere to strict float handling
|
||||
"""
|
||||
|
||||
def test_dumps(self):
|
||||
|
|
Loading…
Reference in New Issue
Block a user