Opened 13 months ago
Closed 13 months ago
#35823 closed Cleanup/optimization (needsinfo)
Document examples for all view decorators
| Reported by: | Adam Johnson | Owned by: | |
|---|---|---|---|
| Component: | Documentation | Version: | dev |
| Severity: | Normal | Keywords: | |
| Cc: | Triage Stage: | Accepted | |
| Has patch: | no | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
This documentation section does not give examples of using each decorator, which makes it much harder to understand. Let’s add one example per decorator.
Change History (1)
comment:1 by , 13 months ago
| Resolution: | → needsinfo |
|---|---|
| Status: | new → closed |
| Triage Stage: | Unreviewed → Accepted |
Note:
See TracTickets
for help on using tickets.
require_GET/POST/safeis probably fine as there is an example forrequire_http_methodsConditional view processing has a topic with examples: https://docs.djangoproject.com/en/dev/topics/conditional-view-processing/
Vary headers has a topic with examples: https://docs.djangoproject.com/en/dev/topics/cache/#using-vary-headers
Cache control is within the cache topic with examples: https://docs.djangoproject.com/en/dev/topics/cache/#controlling-cache-using-other-headers
Append slash has an example with the linked middleware: https://docs.djangoproject.com/en/dev/ref/middleware/#django.middleware.common.CommonMiddleware
GZip compression has no example and doesn't link to the middleware (when I think it should): https://docs.djangoproject.com/en/dev/ref/middleware/#module-django.middleware.gzip
So I think it's roughly there but in different places.
Do you think the examples should be duplicated? Moved over? Or just more prominent links to the topics?