diff options
| author | Aymeric Augustin <aymeric.augustin@m4x.org> | 2012-11-03 21:43:11 +0100 |
|---|---|---|
| committer | Aymeric Augustin <aymeric.augustin@m4x.org> | 2012-11-03 22:07:35 +0100 |
| commit | fc10418fba4fb906e4265650b62c510d526d63f7 (patch) | |
| tree | e00dc8dfa531f03a9ba973e4da80d0f796e83733 /django/forms/formsets.py | |
| parent | 973f539ab83bb46645f2f711190735c66a246797 (diff) | |
Fixed #18963 -- Used a subclass-friendly pattern
for Python 2 object model compatibility methods.
Diffstat (limited to 'django/forms/formsets.py')
| -rw-r--r-- | django/forms/formsets.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/django/forms/formsets.py b/django/forms/formsets.py index c646eed506..a0a38f336f 100644 --- a/django/forms/formsets.py +++ b/django/forms/formsets.py @@ -69,7 +69,9 @@ class BaseFormSet(object): def __bool__(self): """All formsets have a management form which is not included in the length""" return True - __nonzero__ = __bool__ # Python 2 + + def __nonzero__(self): # Python 2 compatibility + return type(self).__bool__(self) @property def management_form(self): |
