aboutsummaryrefslogtreecommitdiffstats
path: root/rest_framework/compat.py
diff options
context:
space:
mode:
authorTom Christie2013-01-02 13:27:00 +0000
committerTom Christie2013-01-02 13:27:00 +0000
commiteff40391fb66f441d2f5a643d5d46f198cf77147 (patch)
treece768dbccfa7194005299762b972874f6b5de156 /rest_framework/compat.py
parentd379997aba5b1e41309bbed8740ed704c0feb58b (diff)
parent389ca3b3b1faa90ea4624f495115d83024fdc151 (diff)
downloaddjango-rest-framework-eff40391fb66f441d2f5a643d5d46f198cf77147.tar.bz2
Merge branch 'patch-support' of https://github.com/ahankinson/django-rest-framework into patch
Diffstat (limited to 'rest_framework/compat.py')
-rw-r--r--rest_framework/compat.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/rest_framework/compat.py b/rest_framework/compat.py
index 86952fb8..5508f6c0 100644
--- a/rest_framework/compat.py
+++ b/rest_framework/compat.py
@@ -96,6 +96,12 @@ else:
update_wrapper(view, cls.dispatch, assigned=())
return view
+# Taken from @markotibold's attempt at supporting PATCH.
+# https://github.com/markotibold/django-rest-framework/tree/patch
+http_method_names = set(View.http_method_names)
+http_method_names.add('patch')
+View.http_method_names = list(http_method_names) # PATCH method is not implemented by Django
+
# PUT, DELETE do not require CSRF until 1.4. They should. Make it better.
if django.VERSION >= (1, 4):
from django.middleware.csrf import CsrfViewMiddleware