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
276ed80f
Commit
276ed80f
authored
Nov 01, 2016
by
Tom Christie
Committed by
GitHub
Nov 01, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support 'on'/'off' literals with BooleanField. Closes #4624 (#4640)
parent
70385711
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
2 deletions
+14
-2
rest_framework/fields.py
+14
-2
No files found.
rest_framework/fields.py
View file @
276ed80f
...
@@ -644,8 +644,20 @@ class BooleanField(Field):
...
@@ -644,8 +644,20 @@ class BooleanField(Field):
}
}
default_empty_html
=
False
default_empty_html
=
False
initial
=
False
initial
=
False
TRUE_VALUES
=
{
't'
,
'T'
,
'true'
,
'True'
,
'TRUE'
,
'1'
,
1
,
True
}
TRUE_VALUES
=
{
FALSE_VALUES
=
{
'f'
,
'F'
,
'false'
,
'False'
,
'FALSE'
,
'0'
,
0
,
0.0
,
False
}
't'
,
'T'
,
'true'
,
'True'
,
'TRUE'
,
'on'
,
'On'
,
'ON'
,
'1'
,
1
,
True
}
FALSE_VALUES
=
{
'f'
,
'F'
,
'false'
,
'False'
,
'FALSE'
,
'off'
,
'Off'
,
'OFF'
,
'0'
,
0
,
0.0
,
False
}
def
__init__
(
self
,
**
kwargs
):
def
__init__
(
self
,
**
kwargs
):
assert
'allow_null'
not
in
kwargs
,
'`allow_null` is not a valid option. Use `NullBooleanField` instead.'
assert
'allow_null'
not
in
kwargs
,
'`allow_null` is not a valid option. Use `NullBooleanField` instead.'
...
...
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