aboutsummaryrefslogtreecommitdiffstats
path: root/rest_framework/request.py
diff options
context:
space:
mode:
authorXavier Ordoquy2013-01-02 16:09:21 +0100
committerXavier Ordoquy2013-01-02 16:09:21 +0100
commit737349d2389197d23886b72c1cb44f53c501ac9a (patch)
tree0c542b6c73deee0280705c8253334126c5f5d254 /rest_framework/request.py
parent5fad46d7e213afed503b1533515cab96875a5936 (diff)
parentd379997aba5b1e41309bbed8740ed704c0feb58b (diff)
downloaddjango-rest-framework-737349d2389197d23886b72c1cb44f53c501ac9a.tar.bz2
Merge remote-tracking branch 'reference/py3k' into p3k
Diffstat (limited to 'rest_framework/request.py')
-rw-r--r--rest_framework/request.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/rest_framework/request.py b/rest_framework/request.py
index 05424f21..c50ae5ad 100644
--- a/rest_framework/request.py
+++ b/rest_framework/request.py
@@ -170,6 +170,15 @@ class Request(object):
self._user, self._auth = self._authenticate()
return self._user
+ @user.setter
+ def user(self, value):
+ """
+ Sets the user on the current request. This is necessary to maintain
+ compatilbility with django.contrib.auth where the user proprety is
+ set in the login and logout functions.
+ """
+ self._user = value
+
@property
def auth(self):
"""
@@ -180,6 +189,14 @@ class Request(object):
self._user, self._auth = self._authenticate()
return self._auth
+ @auth.setter
+ def auth(self, value):
+ """
+ Sets any non-user authentication information associated with the
+ request, such as an authentication token.
+ """
+ self._auth = value
+
def _load_data_and_files(self):
"""
Parses the request content into self.DATA and self.FILES.