mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-10 19:56:59 +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
|
## 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
|
## 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.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
|
@ -55,7 +55,7 @@ We recommend using [Travis CI][travis-ci], a hosted continuous integration servi
|
||||||
|
|
||||||
To get started with Travis CI, [sign in][travis-ci] with your GitHub account. Once you're signed in, go to your [profile page][travis-profile] and enable the service hook for the repository you want.
|
To get started with Travis CI, [sign in][travis-ci] with your GitHub account. Once you're signed in, go to your [profile page][travis-profile] and enable the service hook for the repository you want.
|
||||||
|
|
||||||
If you use the cookiecutter template, your project will already contain a `.travis.yml` file which Travis CI will use to build your project and run tests. By default, builds are triggered everytime you push to your repository or create Pull Request.
|
If you use the cookiecutter template, your project will already contain a `.travis.yml` file which Travis CI will use to build your project and run tests. By default, builds are triggered every time you push to your repository or create Pull Request.
|
||||||
|
|
||||||
#### Uploading to PyPI
|
#### Uploading to PyPI
|
||||||
|
|
||||||
|
|
|
@ -480,7 +480,7 @@ An `APIView`, with an explicit method docstring.
|
||||||
usernames = [user.username for user in User.objects.all()]
|
usernames = [user.username for user in User.objects.all()]
|
||||||
return Response(usernames)
|
return Response(usernames)
|
||||||
|
|
||||||
A `ViewSet`, with an explict action docstring.
|
A `ViewSet`, with an explicit action docstring.
|
||||||
|
|
||||||
class ListUsernames(ViewSet):
|
class ListUsernames(ViewSet):
|
||||||
def list(self, request):
|
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
|
## Generating documentation from OpenAPI schemas
|
||||||
|
|
||||||
There are a number of packages available that allow you to generate HTML
|
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].
|
Two popular options are [Swagger UI][swagger-ui] and [ReDoc][redoc].
|
||||||
|
|
||||||
|
|
|
@ -976,7 +976,7 @@ class ModelSerializer(Serializer):
|
||||||
instance.save()
|
instance.save()
|
||||||
|
|
||||||
# Note that many-to-many fields are set after updating instance.
|
# 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()
|
# updated instance and we do not want it to collide with .update()
|
||||||
for attr, value in m2m_fields:
|
for attr, value in m2m_fields:
|
||||||
field = getattr(instance, attr)
|
field = getattr(instance, attr)
|
||||||
|
|
|
@ -233,7 +233,7 @@ def format_value(value):
|
||||||
def items(value):
|
def items(value):
|
||||||
"""
|
"""
|
||||||
Simple filter to return the items of the dict. Useful when the dict may
|
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
|
lookup. See issue #4931
|
||||||
Also see: https://stackoverflow.com/questions/15416662/django-template-loop-over-dictionary-items-with-items-as-key
|
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.
|
and slightly modify the view function that is created and returned.
|
||||||
"""
|
"""
|
||||||
# The name and description initkwargs may be explicitly overridden for
|
# 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.name = None
|
||||||
cls.description = None
|
cls.description = None
|
||||||
|
|
||||||
|
|
|
@ -303,7 +303,7 @@ class TestRegularFieldMappings(TestCase):
|
||||||
def test_invalid_field(self):
|
def test_invalid_field(self):
|
||||||
"""
|
"""
|
||||||
Field names that do not map to a model field or relationship should
|
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 TestSerializer(serializers.ModelSerializer):
|
||||||
class Meta:
|
class Meta:
|
||||||
|
|
|
@ -540,7 +540,7 @@ class SchemaLinksTests(TestCase):
|
||||||
]
|
]
|
||||||
),
|
),
|
||||||
'create': coreapi.Link(
|
'create': coreapi.Link(
|
||||||
url='/aniamls/cat',
|
url='/animals/cat',
|
||||||
action='post',
|
action='post',
|
||||||
fields=[]
|
fields=[]
|
||||||
)
|
)
|
||||||
|
@ -589,7 +589,7 @@ class SchemaLinksTests(TestCase):
|
||||||
]
|
]
|
||||||
),
|
),
|
||||||
'create': coreapi.Link(
|
'create': coreapi.Link(
|
||||||
url='/aniamls/cat',
|
url='/animals/cat',
|
||||||
action='post',
|
action='post',
|
||||||
fields=[]
|
fields=[]
|
||||||
)
|
)
|
||||||
|
|
|
@ -174,7 +174,7 @@ class BreadcrumbTests(TestCase):
|
||||||
|
|
||||||
class JsonFloatTests(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):
|
def test_dumps(self):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user