aboutsummaryrefslogtreecommitdiffstats
path: root/djangorestframework/views.py
diff options
context:
space:
mode:
authorSébastien Piquemal2012-02-07 15:38:54 +0200
committerSébastien Piquemal2012-02-07 15:38:54 +0200
commit21292d31e7ad5ec731c9ef3e471f90cb29054686 (patch)
tree74bed0e6a3970380c8ac611e69c5b5179b8d2cd3 /djangorestframework/views.py
parentca96b4523b4c09489e4bfe726a894a5c6ada78aa (diff)
downloaddjango-rest-framework-21292d31e7ad5ec731c9ef3e471f90cb29054686.tar.bz2
cleaned Request/Response/mixins to have similar interface
Diffstat (limited to 'djangorestframework/views.py')
-rw-r--r--djangorestframework/views.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/djangorestframework/views.py b/djangorestframework/views.py
index 8ba05e35..761737c4 100644
--- a/djangorestframework/views.py
+++ b/djangorestframework/views.py
@@ -83,12 +83,12 @@ class View(ResourceMixin, RequestMixin, ResponseMixin, AuthMixin, DjangoView):
renderer_classes = renderers.DEFAULT_RENDERERS
"""
- List of renderers the resource can serialize the response with, ordered by preference.
+ List of renderer classes the resource can serialize the response with, ordered by preference.
"""
- parsers = parsers.DEFAULT_PARSERS
+ parser_classes = parsers.DEFAULT_PARSERS
"""
- List of parsers the resource can parse the request with.
+ List of parser classes the resource can parse the request with.
"""
authentication = (authentication.UserLoggedInAuthentication,
@@ -210,7 +210,7 @@ class View(ResourceMixin, RequestMixin, ResponseMixin, AuthMixin, DjangoView):
try:
# Get a custom request, built form the original request instance
- self.request = request = self.get_request()
+ request = self.prepare_request(request)
# `initial` is the opportunity to temper with the request,
# even completely replace it.
@@ -229,7 +229,7 @@ class View(ResourceMixin, RequestMixin, ResponseMixin, AuthMixin, DjangoView):
response = handler(request, *args, **kwargs)
# Prepare response for the response cycle.
- self.prepare_response(response)
+ response = self.prepare_response(response)
# Pre-serialize filtering (eg filter complex objects into natively serializable types)
# TODO: ugly hack to handle both HttpResponse and Response.
@@ -251,7 +251,7 @@ class View(ResourceMixin, RequestMixin, ResponseMixin, AuthMixin, DjangoView):
'name': self.get_name(),
'description': self.get_description(),
'renders': self._rendered_media_types,
- 'parses': request._parsed_media_types,
+ 'parses': self._parsed_media_types,
}
form = self.get_bound_form()
if form is not None: