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/modelresource.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'djangorestframework/modelresource.py') diff --git a/djangorestframework/modelresource.py b/djangorestframework/modelresource.py index 55a15d6a..7fa37053 100644 --- a/djangorestframework/modelresource.py +++ b/djangorestframework/modelresource.py @@ -5,15 +5,14 @@ from django.db.models.fields.related import RelatedField from djangorestframework.response import Response, ResponseException from djangorestframework.resource import Resource -from djangorestframework.validators import ModelFormValidatorMixin -from djangorestframework import status +from djangorestframework import status, validators import decimal import inspect import re -class ModelResource(Resource, ModelFormValidatorMixin): +class ModelResource(Resource): """A specialized type of Resource, for resources that map directly to a Django Model. Useful things this provides: @@ -21,6 +20,9 @@ class ModelResource(Resource, ModelFormValidatorMixin): 1. Nice serialization of returned Models and QuerySets. 2. A default set of create/read/update/delete operations.""" + # List of validators to validate, cleanup and type-ify the request content + validators = (validators.ModelFormValidator,) + # The model attribute refers to the Django Model which this Resource maps to. # (The Model's class, rather than an instance of the Model) model = None -- cgit v1.2.3