summaryrefslogtreecommitdiff
path: root/django/forms/models.py
diff options
context:
space:
mode:
authorClaude Paroz <claude@2xlibre.net>2016-12-29 16:27:49 +0100
committerClaude Paroz <claude@2xlibre.net>2017-01-18 20:18:46 +0100
commit7b2f2e74adb36a4334e83130f6abc2f79d395235 (patch)
tree313387ba6a6f1311b43cf5fb4f2576d2d6c4f805 /django/forms/models.py
parentf6acd1d271122d66de8061e75ae26137ddf02658 (diff)
Refs #23919 -- Removed six.<various>_types usage
Thanks Tim Graham and Simon Charette for the reviews.
Diffstat (limited to 'django/forms/models.py')
-rw-r--r--django/forms/models.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/django/forms/models.py b/django/forms/models.py
index 38f6812ba0..c3a1b81c8c 100644
--- a/django/forms/models.py
+++ b/django/forms/models.py
@@ -220,7 +220,7 @@ class ModelFormMetaclass(DeclarativeFieldsMetaclass):
# of ('foo',)
for opt in ['fields', 'exclude', 'localized_fields']:
value = getattr(opts, opt)
- if isinstance(value, six.string_types) and value != ALL_FIELDS:
+ if isinstance(value, str) and value != ALL_FIELDS:
msg = ("%(model)s.Meta.%(opt)s cannot be a string. "
"Did you mean to type: ('%(value)s',)?" % {
'model': new_class.__name__,
@@ -727,7 +727,7 @@ class BaseModelFormSet(BaseFormSet):
}
else:
return ugettext("Please correct the duplicate data for %(field)s, which must be unique.") % {
- "field": get_text_list(unique_check, six.text_type(_("and"))),
+ "field": get_text_list(unique_check, _("and")),
}
def get_date_error_message(self, date_check):
@@ -737,7 +737,7 @@ class BaseModelFormSet(BaseFormSet):
) % {
'field_name': date_check[2],
'date_field': date_check[3],
- 'lookup': six.text_type(date_check[1]),
+ 'lookup': str(date_check[1]),
}
def get_form_error(self):
@@ -1305,7 +1305,7 @@ class ModelMultipleChoiceField(ModelChoiceField):
def prepare_value(self, value):
if (hasattr(value, '__iter__') and
- not isinstance(value, six.text_type) and
+ not isinstance(value, str) and
not hasattr(value, '_meta')):
return [super(ModelMultipleChoiceField, self).prepare_value(v) for v in value]
return super(ModelMultipleChoiceField, self).prepare_value(value)