diff options
Diffstat (limited to 'djangorestframework/modelresource.py')
| -rw-r--r-- | djangorestframework/modelresource.py | 8 |
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 |
