[Django] #35823: Document examples for all view decorators

4 views
Skip to first unread message

Django

unread,
Oct 9, 2024, 2:34:45 PM10/9/24
to django-...@googlegroups.com
#35823: Document examples for all view decorators
-------------------------------------+-------------------------------------
Reporter: Adam Johnson | Type:
| Cleanup/optimization
Status: new | Component:
| Documentation
Version: dev | Severity: Normal
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
[https://docs.djangoproject.com/en/dev/topics/http/decorators/ 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.
--
Ticket URL: <https://code.djangoproject.com/ticket/35823>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Oct 10, 2024, 4:28:22 AM10/10/24
to django-...@googlegroups.com
#35823: Document examples for all view decorators
-------------------------------------+-------------------------------------
Reporter: Adam Johnson | Owner: (none)
Type: | Status: closed
Cleanup/optimization |
Component: Documentation | Version: dev
Severity: Normal | Resolution: needsinfo
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Sarah Boyce):

* resolution: => needsinfo
* stage: Unreviewed => Accepted
* status: new => closed

Comment:

`require_GET/POST/safe` is probably fine as there is an example for
`require_http_methods`

Conditional 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?
--
Ticket URL: <https://code.djangoproject.com/ticket/35823#comment:1>
Reply all
Reply to author
Forward
0 new messages