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:08:05 +0100 |
| commit | d7688a010a34033a5cc8eecf7b1460169c0e056e (patch) | |
| tree | ec6e0ffea3410d0c7b743d77d123f5eba1db8a0e /django/forms/formsets.py | |
| parent | be6522561f01aa2a0b503fb35f35c9fd34c5110f (diff) | |
[1.5.x] Fixed #18963 -- Used a subclass-friendly pattern
for Python 2 object model compatibility methods.
Backport of fc10418 from master.
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): |
