From a9df917d10e5f84090074e11213eb6d550c174cc Mon Sep 17 00:00:00 2001 From: Tom Christie Date: Mon, 11 Apr 2011 15:03:49 +0100 Subject: Lots of validator tests passing after refactor --- djangorestframework/resource.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'djangorestframework/resource.py') diff --git a/djangorestframework/resource.py b/djangorestframework/resource.py index c5faf175..02c55663 100644 --- a/djangorestframework/resource.py +++ b/djangorestframework/resource.py @@ -3,10 +3,9 @@ from django.views.decorators.csrf import csrf_exempt from djangorestframework.compat import View from djangorestframework.emitters import EmitterMixin -from djangorestframework.validators import FormValidatorMixin from djangorestframework.response import Response, ResponseException from djangorestframework.request import RequestMixin, AuthMixin -from djangorestframework import emitters, parsers, authenticators, status +from djangorestframework import emitters, parsers, authenticators, validators, status # TODO: Figure how out references and named urls need to work nicely @@ -17,7 +16,7 @@ from djangorestframework import emitters, parsers, authenticators, status __all__ = ['Resource'] -class Resource(EmitterMixin, AuthMixin, FormValidatorMixin, RequestMixin, View): +class Resource(EmitterMixin, AuthMixin, RequestMixin, View): """Handles incoming requests and maps them to REST operations, performing authentication, input deserialization, input validation, output serialization.""" @@ -38,7 +37,10 @@ class Resource(EmitterMixin, AuthMixin, FormValidatorMixin, RequestMixin, View): parsers = ( parsers.JSONParser, parsers.FormParser, parsers.MultipartParser ) - + + # List of validators to validate, cleanup and type-ify the request content + validators = (validators.FormValidator,) + # List of all authenticating methods to attempt. authenticators = ( authenticators.UserLoggedInAuthenticator, authenticators.BasicAuthenticator ) -- cgit v1.2.3