1
0
mirror of https://github.com/django/django.git synced 2025-10-25 14:46:09 +00:00

[py3] Replaced unicode/str by six.text_type/bytes.

This commit is contained in:
Aymeric Augustin
2012-07-20 14:48:51 +02:00
parent 3cb2457f46
commit bdca5ea345
96 changed files with 376 additions and 294 deletions

View File

@@ -7,6 +7,7 @@ from django.forms.util import ErrorList
from django.forms.widgets import Media, HiddenInput
from django.utils.encoding import StrAndUnicode
from django.utils.safestring import mark_safe
from django.utils import six
from django.utils.translation import ugettext as _
@@ -345,17 +346,17 @@ class BaseFormSet(StrAndUnicode):
# probably should be. It might make sense to render each form as a
# table row with each field as a td.
forms = ' '.join([form.as_table() for form in self])
return mark_safe('\n'.join([unicode(self.management_form), forms]))
return mark_safe('\n'.join([six.text_type(self.management_form), forms]))
def as_p(self):
"Returns this formset rendered as HTML <p>s."
forms = ' '.join([form.as_p() for form in self])
return mark_safe('\n'.join([unicode(self.management_form), forms]))
return mark_safe('\n'.join([six.text_type(self.management_form), forms]))
def as_ul(self):
"Returns this formset rendered as HTML <li>s."
forms = ' '.join([form.as_ul() for form in self])
return mark_safe('\n'.join([unicode(self.management_form), forms]))
return mark_safe('\n'.join([six.text_type(self.management_form), forms]))
def formset_factory(form, formset=BaseFormSet, extra=1, can_order=False,
can_delete=False, max_num=None):