mirror of
https://github.com/django/django.git
synced 2025-10-25 14:46:09 +00:00
[py3] Replaced __nonzero__ by __bool__
Of course, __nonzero__ alias has been kept for Python 2 compatibility.
This commit is contained in:
@@ -65,9 +65,10 @@ class BaseFormSet(StrAndUnicode):
|
||||
def __len__(self):
|
||||
return len(self.forms)
|
||||
|
||||
def __nonzero__(self):
|
||||
def __bool__(self):
|
||||
"""All formsets have a management form which is not included in the length"""
|
||||
return True
|
||||
__nonzero__ = __bool__ # Python 2
|
||||
|
||||
def _management_form(self):
|
||||
"""Returns the ManagementForm instance for this FormSet."""
|
||||
|
||||
Reference in New Issue
Block a user