diff options
| author | Tom Christie | 2011-04-11 17:13:11 +0100 |
|---|---|---|
| committer | Tom Christie | 2011-04-11 17:13:11 +0100 |
| commit | 18bbda84b9c663fec6eede112a21cf1a48103303 (patch) | |
| tree | 841d1a167b823cbca7a5c487f6dbee4346db4b24 /djangorestframework/resource.py | |
| parent | 6096b50dbe20349144aa92660c6c8467f67f50e7 (diff) | |
| download | django-rest-framework-18bbda84b9c663fec6eede112a21cf1a48103303.tar.bz2 | |
depercate auth and content arguments to the request handler methods - yea :)
Diffstat (limited to 'djangorestframework/resource.py')
| -rw-r--r-- | djangorestframework/resource.py | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/djangorestframework/resource.py b/djangorestframework/resource.py index f4460c1e..0615a164 100644 --- a/djangorestframework/resource.py +++ b/djangorestframework/resource.py @@ -57,22 +57,22 @@ class Resource(RequestMixin, ResponseMixin, AuthMixin, View): callmap = { 'GET': 'get', 'POST': 'post', 'PUT': 'put', 'DELETE': 'delete' } - def get(self, request, auth, *args, **kwargs): + def get(self, request, *args, **kwargs): """Must be subclassed to be implemented.""" self.not_implemented('GET') - def post(self, request, auth, content, *args, **kwargs): + def post(self, request, *args, **kwargs): """Must be subclassed to be implemented.""" self.not_implemented('POST') - def put(self, request, auth, content, *args, **kwargs): + def put(self, request, *args, **kwargs): """Must be subclassed to be implemented.""" self.not_implemented('PUT') - def delete(self, request, auth, *args, **kwargs): + def delete(self, request, *args, **kwargs): """Must be subclassed to be implemented.""" self.not_implemented('DELETE') @@ -154,11 +154,7 @@ class Resource(RequestMixin, ResponseMixin, AuthMixin, View): # Either generate the response data, deserializing and validating any request data # TODO: This is going to change to: func(request, *args, **kwargs) # That'll work out now that we have the lazily evaluated self.CONTENT property. - if self.method in ('PUT', 'POST'): - response_obj = func(request, auth_context, self.CONTENT, *args, **kwargs) - - else: - response_obj = func(request, auth_context, *args, **kwargs) + response_obj = func(request, *args, **kwargs) # Allow return value to be either Response, or an object, or None if isinstance(response_obj, Response): |
