summaryrefslogtreecommitdiff
path: root/django/db/models/fields/files.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/db/models/fields/files.py
parentf6acd1d271122d66de8061e75ae26137ddf02658 (diff)
Refs #23919 -- Removed six.<various>_types usage
Thanks Tim Graham and Simon Charette for the reviews.
Diffstat (limited to 'django/db/models/fields/files.py')
-rw-r--r--django/db/models/fields/files.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/django/db/models/fields/files.py b/django/db/models/fields/files.py
index e52cc1164d..90b6515409 100644
--- a/django/db/models/fields/files.py
+++ b/django/db/models/fields/files.py
@@ -9,7 +9,6 @@ from django.core.files.storage import default_storage
from django.core.validators import validate_image_file_extension
from django.db.models import signals
from django.db.models.fields import Field
-from django.utils import six
from django.utils.encoding import force_str, force_text
from django.utils.translation import ugettext_lazy as _
@@ -181,7 +180,7 @@ class FileDescriptor(object):
# subclasses might also want to subclass the attribute class]. This
# object understands how to convert a path to a file, and also how to
# handle None.
- if isinstance(file, six.string_types) or file is None:
+ if isinstance(file, str) or file is None:
attr = self.field.attr_class(instance, self.field, file)
instance.__dict__[self.field.name] = attr
@@ -253,7 +252,7 @@ class FileField(Field):
return []
def _check_upload_to(self):
- if isinstance(self.upload_to, six.string_types) and self.upload_to.startswith('/'):
+ if isinstance(self.upload_to, str) and self.upload_to.startswith('/'):
return [
checks.Error(
"%s's 'upload_to' argument must be a relative path, not an "
@@ -284,7 +283,7 @@ class FileField(Field):
# Need to convert File objects provided via a form to unicode for database insertion
if value is None:
return None
- return six.text_type(value)
+ return str(value)
def pre_save(self, model_instance, add):
"Returns field's value just before saving."