mirror of
https://github.com/django/django.git
synced 2025-11-18 11:00:24 +00:00
Refs #23919 -- Removed six.<various>_types usage
Thanks Tim Graham and Simon Charette for the reviews.
This commit is contained in:
parent
f6acd1d271
commit
7b2f2e74ad
213 changed files with 574 additions and 763 deletions
|
|
@ -10,7 +10,6 @@ from django.core.exceptions import ObjectDoesNotExist
|
|||
from django.db.models.fields.related import ManyToManyRel
|
||||
from django.forms.utils import flatatt
|
||||
from django.template.defaultfilters import capfirst, linebreaksbr
|
||||
from django.utils import six
|
||||
from django.utils.encoding import force_text
|
||||
from django.utils.html import conditional_escape, format_html
|
||||
from django.utils.safestring import mark_safe
|
||||
|
|
@ -99,7 +98,7 @@ class Fieldset(object):
|
|||
class Fieldline(object):
|
||||
def __init__(self, form, field, readonly_fields=None, model_admin=None):
|
||||
self.form = form # A django.forms.Form instance
|
||||
if not hasattr(field, "__iter__") or isinstance(field, six.text_type):
|
||||
if not hasattr(field, "__iter__") or isinstance(field, str):
|
||||
self.fields = [field]
|
||||
else:
|
||||
self.fields = field
|
||||
|
|
@ -217,7 +216,7 @@ class AdminReadonlyField(object):
|
|||
result_repr = linebreaksbr(force_text(value))
|
||||
else:
|
||||
if isinstance(f.remote_field, ManyToManyRel) and value is not None:
|
||||
result_repr = ", ".join(map(six.text_type, value.all()))
|
||||
result_repr = ", ".join(map(str, value.all()))
|
||||
else:
|
||||
result_repr = display_for_field(value, f, self.empty_value_display)
|
||||
result_repr = linebreaksbr(result_repr)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue