Merge pull request #23 from abelsonlive/master
allow keys arg for upsert to be a string
This commit is contained in:
commit
b14b73e320
@ -147,6 +147,10 @@ class Table(object):
|
|||||||
data = dict(id=10, title='I am a banana!')
|
data = dict(id=10, title='I am a banana!')
|
||||||
table.upsert(data, ['id'])
|
table.upsert(data, ['id'])
|
||||||
"""
|
"""
|
||||||
|
# check whether keys arg is a string and format as a list
|
||||||
|
if isinstance(keys, basestring):
|
||||||
|
keys = [keys]
|
||||||
|
|
||||||
self._check_dropped()
|
self._check_dropped()
|
||||||
if ensure:
|
if ensure:
|
||||||
self.create_index(keys)
|
self.create_index(keys)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user