Ticket #17288: patch.diff

File patch.diff, 1.2 KB (added by luca.cappa@…, 13 years ago)
  • django/views/generic/base.py

     
    5353        update_wrapper(view, cls.dispatch, assigned=())
    5454        return view
    5555
     56    # @returns The function name to be called when the HTTP method 'http_method_name'is
     57    # requested.
     58    # @param http_method_name The HTTP method name, i.e. 'get', 'post' and so forth.
     59    def get_method_name_for_http_method(self, http_method_name):
     60        return http_method_name.lower()
     61
    5662    def dispatch(self, request, *args, **kwargs):
    5763        # Try to dispatch to the right method; if a method doesn't exist,
    5864        # defer to the error handler. Also defer to the error handler if the
    5965        # request method isn't on the approved list.
    6066        if request.method.lower() in self.http_method_names:
    61             handler = getattr(self, request.method.lower(), self.http_method_not_allowed)
     67            handler = getattr(self, self.get_method_name_for_http_method(request.method), self.http_method_not_allowed)
    6268        else:
    6369            handler = self.http_method_not_allowed
    6470        self.request = request
Back to Top