Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
django-rest-framework
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
django-rest-framework
Commits
3039f6f6
Commit
3039f6f6
authored
May 16, 2011
by
Tom Christie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
validators tests -> resources tests
parent
34701343
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
3 deletions
+7
-3
djangorestframework/resources.py
+7
-3
djangorestframework/tests/validators.py
+0
-0
No files found.
djangorestframework/resources.py
View file @
3039f6f6
...
@@ -188,9 +188,13 @@ class FormResource(Resource):
...
@@ -188,9 +188,13 @@ class FormResource(Resource):
def
_validate
(
self
,
data
,
files
,
allowed_extra_fields
=
(),
fake_data
=
None
):
def
_validate
(
self
,
data
,
files
,
allowed_extra_fields
=
(),
fake_data
=
None
):
"""
"""
Wrapped by validate to hide the extra_fields option that the ModelValidatorMixin uses.
Wrapped by validate to hide the extra flags that are used in the implementation.
extra_fields is a list of fields which are not defined by the form, but which we still
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.
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.
# We'd like nice error messages even if no content is supplied.
...
@@ -369,7 +373,7 @@ class ModelResource(FormResource):
...
@@ -369,7 +373,7 @@ class ModelResource(FormResource):
if
self
.
form
:
if
self
.
form
:
# Use explict Form
# Use explict Form
return
super
(
Model
FormValidator
,
self
)
.
get_bound_form
(
data
,
files
)
return
super
(
Model
Resource
,
self
)
.
get_bound_form
(
data
,
files
)
elif
self
.
model
:
elif
self
.
model
:
# Fall back to ModelForm which we create on the fly
# Fall back to ModelForm which we create on the fly
...
...
djangorestframework/tests/validators.py
View file @
3039f6f6
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment