blacken-docs: Manual fixes for command to pass without errors

This commit is contained in:
Joseph Victor Zammit 2023-03-15 12:09:05 +01:00
parent 6b73acc173
commit 1ecc66b34f
4 changed files with 11 additions and 11 deletions

View File

@ -263,7 +263,7 @@ class CustomSchema(AutoSchema):
class CustomView(APIView):
schema = CustomSchema()
schema_extra_info = ... some extra info ...
schema_extra_info = ... # some extra info
```
Here, the `AutoSchema` subclass goes looking for `schema_extra_info` on the
@ -281,7 +281,7 @@ class BaseSchema(AutoSchema):
...
class CustomSchema(BaseSchema):
extra_info = ... some extra info ...
extra_info = ... # some extra info
class CustomView(APIView):
schema = CustomSchema()
@ -304,7 +304,7 @@ class CustomSchema(BaseSchema):
class CustomView(APIView):
schema = CustomSchema(
extra_info=... some extra info ...
extra_info=... # some extra info
)
```

View File

@ -213,14 +213,14 @@ Note that the `basename` is provided by the router during `ViewSet` registration
Using the example from the previous section:
```python
```pycon
>>> view.reverse_action('set-password', args=['1'])
'http://localhost:8000/api/users/1/set_password'
```
Alternatively, you can use the `url_name` attribute set by the `@action` decorator.
```python
```pycon
>>> view.reverse_action(view.set_password.url_name, args=['1'])
'http://localhost:8000/api/users/1/set_password'
```

View File

@ -41,8 +41,8 @@ update your REST framework settings to include `DEFAULT_SCHEMA_CLASS` explicitly
```python
REST_FRAMEWORK = {
...
'DEFAULT_SCHEMA_CLASS': 'rest_framework.schemas.coreapi.AutoSchema'
...: ...,
'DEFAULT_SCHEMA_CLASS': 'rest_framework.schemas.coreapi.AutoSchema',
}
```

View File

@ -43,10 +43,10 @@ be extracted from the class docstring:
```python
class DocStringExampleListView(APIView):
"""
get: A description of my GET operation.
post: A description of my POST operation.
"""
"""
get: A description of my GET operation.
post: A description of my POST operation.
"""
permission_classes = [permissions.IsAuthenticatedOrReadOnly]
def get(self, request, *args, **kwargs):