[Django] #29661: Generalized View decorator for Http Request attributes

3 views
Skip to first unread message

Django

unread,
Aug 11, 2018, 4:08:55 AM8/11/18
to django-...@googlegroups.com
#29661: Generalized View decorator for Http Request attributes
-----------------------------------------+------------------------
Reporter: sumitgoelpw | Owner: nobody
Type: New feature | Status: new
Component: Uncategorized | Version: 2.1
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 |
-----------------------------------------+------------------------
Currently, there are few View decorators as documented at
https://docs.djangoproject.com/en/2.1/topics/http/decorators/ and I like
to request more general decorator that can be used to allow other
attributes of HTTP request. For example, "Allowed HTTP methods" is
excellent, and I also want to be able to allow specific content type (e.g.
application/json) or other meta attributes.

--
Ticket URL: <https://code.djangoproject.com/ticket/29661>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Aug 11, 2018, 6:31:12 AM8/11/18
to django-...@googlegroups.com
#29661: Generalized View decorator for Http Request attributes
-------------------------------+--------------------------------------
Reporter: Sumit Goel | Owner: nobody
Type: New feature | Status: closed
Component: Uncategorized | Version: 2.1
Severity: Normal | Resolution: wontfix

Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------
Changes (by Claude Paroz):

* status: new => closed
* resolution: => wontfix


Comment:

If you have specific needs, you can freely copy the general structure of
the `require_http_methods` Django decorator and adapt it to your needs. I
don't see at first a general enough interest to provide other decorators.
But you may develop a bit more the use cases if you think they would be of
general interest.

--
Ticket URL: <https://code.djangoproject.com/ticket/29661#comment:1>

Reply all
Reply to author
Forward
0 new messages