mirror of
https://github.com/django/django.git
synced 2025-10-29 16:46:11 +00:00
[py3] Replaced unicode/str by six.text_type/bytes.
This commit is contained in:
@@ -2,6 +2,7 @@ import random
|
||||
import string
|
||||
|
||||
from django.db import models
|
||||
from django.utils import six
|
||||
|
||||
|
||||
class MyWrapper(object):
|
||||
@@ -44,12 +45,12 @@ class MyAutoField(models.CharField):
|
||||
if not value:
|
||||
return
|
||||
if isinstance(value, MyWrapper):
|
||||
return unicode(value)
|
||||
return six.text_type(value)
|
||||
return value
|
||||
|
||||
def get_db_prep_value(self, value, connection, prepared=False):
|
||||
if not value:
|
||||
return
|
||||
if isinstance(value, MyWrapper):
|
||||
return unicode(value)
|
||||
return six.text_type(value)
|
||||
return value
|
||||
|
||||
Reference in New Issue
Block a user