Remove basestring, unicode from code base
This commit is contained in:
parent
b3520665d7
commit
88c0c1a15f
@ -118,9 +118,8 @@ class Table(object):
|
|||||||
``types``, matching the behavior of :py:meth:`insert() <dataset.Table.insert>`.
|
``types``, matching the behavior of :py:meth:`insert() <dataset.Table.insert>`.
|
||||||
"""
|
"""
|
||||||
# check whether keys arg is a string and format as a list
|
# check whether keys arg is a string and format as a list
|
||||||
if isinstance(keys, basestring):
|
if not isinstance(keys, (list, tuple)):
|
||||||
keys = [keys]
|
keys = [keys]
|
||||||
|
|
||||||
self._check_dropped()
|
self._check_dropped()
|
||||||
if not keys or len(keys)==len(row):
|
if not keys or len(keys)==len(row):
|
||||||
return False
|
return False
|
||||||
@ -153,9 +152,8 @@ class Table(object):
|
|||||||
table.upsert(data, ['id'])
|
table.upsert(data, ['id'])
|
||||||
"""
|
"""
|
||||||
# check whether keys arg is a string and format as a list
|
# check whether keys arg is a string and format as a list
|
||||||
if isinstance(keys, basestring):
|
if not isinstance(keys, (list, tuple)):
|
||||||
keys = [keys]
|
keys = [keys]
|
||||||
|
|
||||||
self._check_dropped()
|
self._check_dropped()
|
||||||
if ensure:
|
if ensure:
|
||||||
self.create_index(keys)
|
self.create_index(keys)
|
||||||
@ -317,7 +315,7 @@ class Table(object):
|
|||||||
For more complex queries, please use :py:meth:`db.query() <dataset.Database.query>`
|
For more complex queries, please use :py:meth:`db.query() <dataset.Database.query>`
|
||||||
instead."""
|
instead."""
|
||||||
self._check_dropped()
|
self._check_dropped()
|
||||||
if isinstance(order_by, (str, unicode)):
|
if not isinstance(order_by, (list, tuple)):
|
||||||
order_by = [order_by]
|
order_by = [order_by]
|
||||||
order_by = filter(lambda o: o in self.table.columns, order_by)
|
order_by = filter(lambda o: o in self.table.columns, order_by)
|
||||||
order_by = [self._args_to_order_by(o) for o in order_by]
|
order_by = [self._args_to_order_by(o) for o in order_by]
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user