mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-09-17 01:32:30 +03:00
blacken-docs: Adds commas at the end to make it look identical to pre-black version
This commit is contained in:
parent
9586719c45
commit
a19a202d3a
|
@ -31,20 +31,20 @@ class UserViewSet(viewsets.ViewSet):
|
||||||
@method_decorator(cache_page(60 * 60 * 2))
|
@method_decorator(cache_page(60 * 60 * 2))
|
||||||
@method_decorator(vary_on_cookie)
|
@method_decorator(vary_on_cookie)
|
||||||
def list(self, request, format=None):
|
def list(self, request, format=None):
|
||||||
content = {"user_feed": request.user.get_user_feed()}
|
content = {
|
||||||
|
"user_feed": request.user.get_user_feed(),
|
||||||
|
}
|
||||||
return Response(content)
|
return Response(content)
|
||||||
|
|
||||||
|
|
||||||
class ProfileView(APIView):
|
class ProfileView(APIView):
|
||||||
# With auth: cache requested url for each user for 2 hours
|
# With auth: cache requested url for each user for 2 hours
|
||||||
@method_decorator(cache_page(60 * 60 * 2))
|
@method_decorator(cache_page(60 * 60 * 2))
|
||||||
@method_decorator(
|
@method_decorator(vary_on_headers("Authorization"))
|
||||||
vary_on_headers(
|
|
||||||
"Authorization",
|
|
||||||
)
|
|
||||||
)
|
|
||||||
def get(self, request, format=None):
|
def get(self, request, format=None):
|
||||||
content = {"user_feed": request.user.get_user_feed()}
|
content = {
|
||||||
|
"user_feed": request.user.get_user_feed(),
|
||||||
|
}
|
||||||
return Response(content)
|
return Response(content)
|
||||||
|
|
||||||
|
|
||||||
|
@ -52,7 +52,10 @@ class PostView(APIView):
|
||||||
# Cache page for the requested url
|
# Cache page for the requested url
|
||||||
@method_decorator(cache_page(60 * 60 * 2))
|
@method_decorator(cache_page(60 * 60 * 2))
|
||||||
def get(self, request, format=None):
|
def get(self, request, format=None):
|
||||||
content = {"title": "Post title", "body": "Post content"}
|
content = {
|
||||||
|
"title": "Post title",
|
||||||
|
"body": "Post content",
|
||||||
|
}
|
||||||
return Response(content)
|
return Response(content)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user