Using string_type instead of str and unicode

This commit is contained in:
Dmitriy Krasilnikov 2014-12-20 11:38:16 +08:00
parent 6ce92c4ea4
commit 9abd91dafa

View file

@ -105,7 +105,7 @@ class MultiSelectField(models.CharField):
return '' if value is None else ",".join(value)
def get_db_prep_value(self, value, connection, prepared=False):
if not prepared and not isinstance(value, str) and not isinstance(value, unicode):
if not prepared and not isinstance(value, string_type):
value = self.get_prep_value(value)
return value