aboutsummaryrefslogtreecommitdiffstats
path: root/rest_framework/views.py
diff options
context:
space:
mode:
authorTom Christie2013-04-09 18:22:39 +0100
committerTom Christie2013-04-09 18:22:39 +0100
commitc73d0e1e39e661c7324eb0df8c3ce6e18f57915b (patch)
tree54862d6affb779b3c39102b975dd3c4d753efe55 /rest_framework/views.py
parent027792c981b1442a018e382a6fa2e58496b0b750 (diff)
downloaddjango-rest-framework-c73d0e1e39e661c7324eb0df8c3ce6e18f57915b.tar.bz2
Minor cleaning up on View
Diffstat (limited to 'rest_framework/views.py')
-rw-r--r--rest_framework/views.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/rest_framework/views.py b/rest_framework/views.py
index 12298ca5..d7d3a2e2 100644
--- a/rest_framework/views.py
+++ b/rest_framework/views.py
@@ -38,10 +38,9 @@ class APIView(View):
@property
def allowed_methods(self):
"""
- Return the list of allowed HTTP methods, uppercased.
+ Wrap Django's private `_allowed_methods` interface in a public property.
"""
- return [method.upper() for method in self.http_method_names
- if hasattr(self, method)]
+ return self._allowed_methods()
@property
def default_response_headers(self):
@@ -69,7 +68,8 @@ class APIView(View):
def http_method_not_allowed(self, request, *args, **kwargs):
"""
- Called if `request.method` does not correspond to a handler method.
+ If `request.method` does not correspond to a handler method,
+ determine what kind of exception to raise.
"""
raise exceptions.MethodNotAllowed(request.method)