mirror of
https://github.com/django/django.git
synced 2025-09-28 04:54:53 +00:00
Simplified comment in BooleanField.to_python().
This commit is contained in:
parent
25dd595742
commit
4263cd0e09
1 changed files with 1 additions and 2 deletions
|
@ -998,8 +998,7 @@ class BooleanField(Field):
|
||||||
if self.null and value in self.empty_values:
|
if self.null and value in self.empty_values:
|
||||||
return None
|
return None
|
||||||
if value in (True, False):
|
if value in (True, False):
|
||||||
# if value is 1 or 0 than it's equal to True or False, but we want
|
# 1/0 are equal to True/False. bool() converts former to latter.
|
||||||
# to return a true bool for semantic reasons.
|
|
||||||
return bool(value)
|
return bool(value)
|
||||||
if value in ('t', 'True', '1'):
|
if value in ('t', 'True', '1'):
|
||||||
return True
|
return True
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue