Opened 6 years ago

Closed 6 years ago

#29661 closed New feature (wontfix)

Generalized View decorator for Http Request attributes

Reported by: Sumit Goel Owned by: nobody
Component: Uncategorized Version: 2.1
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

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.

Change History (1)

comment:1 by Claude Paroz, 6 years ago

Resolution: wontfix
Status: newclosed

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.

Note: See TracTickets for help on using tickets.
Back to Top