aboutsummaryrefslogtreecommitdiffstats
path: root/djangorestframework/resources.py
diff options
context:
space:
mode:
authorTom Christie2011-05-16 16:52:39 +0100
committerTom Christie2011-05-16 16:52:39 +0100
commit3039f6f6c29d0b469810adcd6ba450361f2a16de (patch)
treee74b4563c847800889177fd48718846073727016 /djangorestframework/resources.py
parent3470134373658f4f332d6b6fba038ef7b43bbf9f (diff)
downloaddjango-rest-framework-3039f6f6c29d0b469810adcd6ba450361f2a16de.tar.bz2
validators tests -> resources tests
Diffstat (limited to 'djangorestframework/resources.py')
-rw-r--r--djangorestframework/resources.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/djangorestframework/resources.py b/djangorestframework/resources.py
index 8a9373cf..fa3dd1b7 100644
--- a/djangorestframework/resources.py
+++ b/djangorestframework/resources.py
@@ -188,9 +188,13 @@ class FormResource(Resource):
def _validate(self, data, files, allowed_extra_fields=(), fake_data=None):
"""
- Wrapped by validate to hide the extra_fields option that the ModelValidatorMixin uses.
- extra_fields is a list of fields which are not defined by the form, but which we still
+ Wrapped by validate to hide the extra flags that are used in the implementation.
+
+ allowed_extra_fields is a list of fields which are not defined by the form, but which we still
expect to see on the input.
+
+ fake_data is a string that should be used as an extra key, as a kludge to force .errors
+ to be populated when an empty dict is supplied in `data`
"""
# We'd like nice error messages even if no content is supplied.
@@ -369,7 +373,7 @@ class ModelResource(FormResource):
if self.form:
# Use explict Form
- return super(ModelFormValidator, self).get_bound_form(data, files)
+ return super(ModelResource, self).get_bound_form(data, files)
elif self.model:
# Fall back to ModelForm which we create on the fly