From 1ecc66b34ff1a80c3327083c7b7f40b7ab818b4b Mon Sep 17 00:00:00 2001 From: Joseph Victor Zammit Date: Wed, 15 Mar 2023 12:09:05 +0100 Subject: [PATCH] blacken-docs: Manual fixes for command to pass without errors --- docs/api-guide/schemas.md | 6 +++--- docs/api-guide/viewsets.md | 4 ++-- docs/community/3.10-announcement.md | 4 ++-- docs/community/3.11-announcement.md | 8 ++++---- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/docs/api-guide/schemas.md b/docs/api-guide/schemas.md index 3f0b15530..992e801f2 100644 --- a/docs/api-guide/schemas.md +++ b/docs/api-guide/schemas.md @@ -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 ) ``` diff --git a/docs/api-guide/viewsets.md b/docs/api-guide/viewsets.md index 5d5491a83..a5a24cae6 100644 --- a/docs/api-guide/viewsets.md +++ b/docs/api-guide/viewsets.md @@ -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' ``` diff --git a/docs/community/3.10-announcement.md b/docs/community/3.10-announcement.md index 23b6330a7..b03b5a460 100644 --- a/docs/community/3.10-announcement.md +++ b/docs/community/3.10-announcement.md @@ -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', } ``` diff --git a/docs/community/3.11-announcement.md b/docs/community/3.11-announcement.md index 83dd636d1..d4b91120c 100644 --- a/docs/community/3.11-announcement.md +++ b/docs/community/3.11-announcement.md @@ -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):