Skip to content

Commit

Permalink
blacken-docs: Adds commas at the end to make it look identical to pre…
Browse files Browse the repository at this point in the history
…-black version
  • Loading branch information
jvzammit committed Mar 30, 2023
1 parent 9586719 commit a19a202
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions docs/api-guide/caching.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,28 +31,31 @@ class UserViewSet(viewsets.ViewSet):
@method_decorator(cache_page(60 * 60 * 2))
@method_decorator(vary_on_cookie)
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)


class ProfileView(APIView):
# With auth: cache requested url for each user for 2 hours
@method_decorator(cache_page(60 * 60 * 2))
@method_decorator(
vary_on_headers(
"Authorization",
)
)
@method_decorator(vary_on_headers("Authorization"))
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)


class PostView(APIView):
# Cache page for the requested url
@method_decorator(cache_page(60 * 60 * 2))
def get(self, request, format=None):
content = {"title": "Post title", "body": "Post content"}
content = {
"title": "Post title",
"body": "Post content",
}
return Response(content)
```

Expand Down

0 comments on commit a19a202

Please sign in to comment.