diff --git a/picklefield/fields.py b/picklefield/fields.py index 1e87690..2adb043 100644 --- a/picklefield/fields.py +++ b/picklefield/fields.py @@ -7,7 +7,7 @@ from django import VERSION as DJANGO_VERSION from django.core import checks from django.db import models -from django.utils.encoding import force_text +from django.utils.encoding import force_str from .constants import DEFAULT_PROTOCOL @@ -189,13 +189,13 @@ def get_db_prep_value(self, value, connection=None, prepared=False): """ if value is not None and not isinstance(value, PickledObject): - # We call force_text here explicitly, so that the encoded string + # We call force_str here explicitly, so that the encoded string # isn't rejected by the postgresql_psycopg2 backend. Alternatively, # we could have just registered PickledObject with the psycopg # marshaller (telling it to store it like it would a string), but # since both of these methods result in the same value being stored, # doing things this way is much easier. - value = force_text(dbsafe_encode(value, self.compress, self.protocol, self.copy)) + value = force_str(dbsafe_encode(value, self.compress, self.protocol, self.copy)) return value def value_to_string(self, obj):