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
c94d1e6d
Commit
c94d1e6d
authored
Nov 23, 2014
by
Tony Nguyen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix typo "serailizers" to "serializers"
parent
f7de442e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
docs/topics/3.0-announcement.md
+2
-2
No files found.
docs/topics/3.0-announcement.md
View file @
c94d1e6d
...
@@ -189,13 +189,13 @@ You can either return `non_field_errors` from the validate method by raising a s
...
@@ -189,13 +189,13 @@ You can either return `non_field_errors` from the validate method by raising a s
def validate(self, attrs):
def validate(self, attrs):
# serializer.errors == {'non_field_errors': ['A non field error']}
# serializer.errors == {'non_field_errors': ['A non field error']}
raise ser
ai
lizers.ValidationError('A non field error')
raise ser
ia
lizers.ValidationError('A non field error')
Alternatively if you want the errors to be against a specific field, use a dictionary of when instantiating the
`ValidationError`
, like so:
Alternatively if you want the errors to be against a specific field, use a dictionary of when instantiating the
`ValidationError`
, like so:
def validate(self, attrs):
def validate(self, attrs):
# serializer.errors == {'my_field': ['A field error']}
# serializer.errors == {'my_field': ['A field error']}
raise ser
ai
lizers.ValidationError({'my_field': 'A field error'})
raise ser
ia
lizers.ValidationError({'my_field': 'A field error'})
This ensures you can still write validation that compares all the input fields, but that marks the error against a particular field.
This ensures you can still write validation that compares all the input fields, but that marks the error against a particular field.
...
...
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