summaryrefslogtreecommitdiff
path: root/django/contrib/postgres/fields/hstore.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/contrib/postgres/fields/hstore.py
parentf6acd1d271122d66de8061e75ae26137ddf02658 (diff)
downloaddjango-7b2f2e74adb36a4334e83130f6abc2f79d395235.tar.gz
Refs #23919 -- Removed six.<various>_types usage
Thanks Tim Graham and Simon Charette for the reviews.
Diffstat (limited to 'django/contrib/postgres/fields/hstore.py')
-rw-r--r--django/contrib/postgres/fields/hstore.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/django/contrib/postgres/fields/hstore.py b/django/contrib/postgres/fields/hstore.py
index 605deaf62c..fcd212bc4a 100644
--- a/django/contrib/postgres/fields/hstore.py
+++ b/django/contrib/postgres/fields/hstore.py
@@ -4,7 +4,6 @@ from django.contrib.postgres import forms, lookups
from django.contrib.postgres.fields.array import ArrayField
from django.core import exceptions
from django.db.models import Field, TextField, Transform
-from django.utils import six
from django.utils.encoding import force_text
from django.utils.translation import ugettext_lazy as _
@@ -30,7 +29,7 @@ class HStoreField(Field):
def validate(self, value, model_instance):
super(HStoreField, self).validate(value, model_instance)
for key, val in value.items():
- if not isinstance(val, six.string_types) and val is not None:
+ if not isinstance(val, str) and val is not None:
raise exceptions.ValidationError(
self.error_messages['not_a_string'],
code='not_a_string',
@@ -38,7 +37,7 @@ class HStoreField(Field):
)
def to_python(self, value):
- if isinstance(value, six.string_types):
+ if isinstance(value, str):
value = json.loads(value)
return value