aboutsummaryrefslogtreecommitdiffstats
path: root/djangorestframework/modelresource.py
diff options
context:
space:
mode:
authorTom Christie2011-04-11 15:03:49 +0100
committerTom Christie2011-04-11 15:03:49 +0100
commita9df917d10e5f84090074e11213eb6d550c174cc (patch)
tree7aa898b643bebf667bf461a18d479acfc7085967 /djangorestframework/modelresource.py
parent136c9b5271fc205abffbbe5422b3c345858a533b (diff)
downloaddjango-rest-framework-a9df917d10e5f84090074e11213eb6d550c174cc.tar.bz2
Lots of validator tests passing after refactor
Diffstat (limited to 'djangorestframework/modelresource.py')
-rw-r--r--djangorestframework/modelresource.py8
1 files changed, 5 insertions, 3 deletions
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