Opened 4 years ago

Closed 4 years ago

#17288 closed New feature (wontfix)

allow customization the names of the get(),post(),put() etc methods of a django.views.generic.base.View derived class

Reported by: luca.cappa@… Owned by: nobody
Component: Generic views Version: master
Severity: Normal Keywords: generic view method
Cc: luca.cappa@… Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

It would be useful to not force the usage of 'get', 'post', 'delete', 'put' and so on as the Python method name of a django.views.generic.base.View derived class. For example, what if i want to implement in the derived class a 'delete' method that is not the HTTP delete servicing request method, and instead call the delete servicing method as "DELETE"? The provided patch allow a View derived class to implement the get_method_name_of_http_method() that normally returns the lower case version of the HTTP method name, but it could be overridden in the derived class to customize the HTTP servicing Python method name, like for example if in the derived class we return the HTTP method name uppercased, then the servicing method of the class are named 'GET', 'POST' and so on.

Attachments (1)

patch.diff (1.2 KB) - added by luca.cappa@… 4 years ago.

Download all attachments as: .zip

Change History (2)

Changed 4 years ago by luca.cappa@…

comment:1 Changed 4 years ago by Alex

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to wontfix
  • Status changed from new to closed

Closing as wontfix, as this is a silly level of customization, which doesn't actually add value. These are the names the methods have on a Django View, if you want to add a new method name it something else, as you would in any other class hierarchy.

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