py3: use six.string_types instead of basestring (#46576)
This commit is contained in:
parent
5a10ff7d98
commit
7dfc65e8b9
|
@ -22,6 +22,7 @@ import requests
|
|||
|
||||
from django.views.generic import DetailView as GenericDetailView
|
||||
from django.utils.decorators import method_decorator
|
||||
from django.utils import six
|
||||
from django.utils.six.moves.urllib import parse as urlparse
|
||||
from django.views.decorators.csrf import csrf_exempt
|
||||
|
||||
|
@ -202,7 +203,7 @@ class ResourceView(DetailView):
|
|||
data.type = 'date'
|
||||
value = datetime.strptime(value[:19], '%Y-%m-%dT%H:%M:%S')
|
||||
value = value.strftime('%d-%m-%Y %H:%M:%S')
|
||||
elif isinstance(value, basestring):
|
||||
elif isinstance(value, six.string_types):
|
||||
data.type = 'string'
|
||||
elif isinstance(value, int):
|
||||
data.type = 'integer'
|
||||
|
@ -231,7 +232,7 @@ class ResourceView(DetailView):
|
|||
data.type = 'date'
|
||||
value = datetime.strptime(value[:19], '%Y-%m-%dT%H:%M:%S')
|
||||
value = value.strftime('%d-%m-%Y %H:%M:%S')
|
||||
elif isinstance(value, basestring):
|
||||
elif isinstance(value, six.string_types):
|
||||
data.type = 'string'
|
||||
elif isinstance(value, int):
|
||||
data.type = 'int'
|
||||
|
@ -606,7 +607,7 @@ class DebugView(DetailView):
|
|||
data.type = 'date'
|
||||
value = datetime.strptime(value[:19], '%Y-%m-%dT%H:%M:%S')
|
||||
value = value.strftime('%d-%m-%Y %H:%M:%S')
|
||||
elif isinstance(value, basestring):
|
||||
elif isinstance(value, six.string_types):
|
||||
data.type = 'string'
|
||||
elif isinstance(value, int):
|
||||
data.type = 'integer'
|
||||
|
@ -635,7 +636,7 @@ class DebugView(DetailView):
|
|||
data.type = 'date'
|
||||
value = datetime.strptime(value[:19], '%Y-%m-%dT%H:%M:%S')
|
||||
value = value.strftime('%d-%m-%Y %H:%M:%S')
|
||||
elif isinstance(value, basestring):
|
||||
elif isinstance(value, six.string_types):
|
||||
data.type = 'string'
|
||||
elif isinstance(value, int):
|
||||
data.type = 'int'
|
||||
|
|
Loading…
Reference in New Issue