summaryrefslogtreecommitdiff
path: root/django/forms/formsets.py
diff options
context:
space:
mode:
authorAymeric Augustin <aymeric.augustin@m4x.org>2012-08-12 12:32:08 +0200
committerAymeric Augustin <aymeric.augustin@m4x.org>2012-08-12 14:44:40 +0200
commitd4a0b27838c815af87698920cc4db7d2afd6f05b (patch)
tree6fedc7203389ab1f80f8cc7e913230c51e9b8776 /django/forms/formsets.py
parent79d62a71751140315227891bbe175630f9d3edc3 (diff)
[py3] Refactored __unicode__ to __str__.
* Renamed the __unicode__ methods * Applied the python_2_unicode_compatible decorator * Removed the StrAndUnicode mix-in that is superseded by python_2_unicode_compatible * Kept the __unicode__ methods in classes that specifically test it under Python 2
Diffstat (limited to 'django/forms/formsets.py')
-rw-r--r--django/forms/formsets.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/django/forms/formsets.py b/django/forms/formsets.py
index 4ea8dc4ca9..258c673da8 100644
--- a/django/forms/formsets.py
+++ b/django/forms/formsets.py
@@ -5,7 +5,7 @@ from django.forms import Form
from django.forms.fields import IntegerField, BooleanField
from django.forms.util import ErrorList
from django.forms.widgets import Media, HiddenInput
-from django.utils.encoding import StrAndUnicode
+from django.utils.encoding import python_2_unicode_compatible
from django.utils.safestring import mark_safe
from django.utils import six
from django.utils.six.moves import xrange
@@ -33,7 +33,8 @@ class ManagementForm(Form):
self.base_fields[MAX_NUM_FORM_COUNT] = IntegerField(required=False, widget=HiddenInput)
super(ManagementForm, self).__init__(*args, **kwargs)
-class BaseFormSet(StrAndUnicode):
+@python_2_unicode_compatible
+class BaseFormSet(object):
"""
A collection of instances of the same Form class.
"""
@@ -51,7 +52,7 @@ class BaseFormSet(StrAndUnicode):
# construct the forms in the formset
self._construct_forms()
- def __unicode__(self):
+ def __str__(self):
return self.as_table()
def __iter__(self):