allow keys arg for upsert to be a string
I want to be able to use `upsert` without formatting the keys arg as a list, ie: ``` table.upsert(new_data, "id") ```
This commit is contained in:
parent
a228f48e23
commit
904e464dfa
@ -147,6 +147,10 @@ class Table(object):
|
||||
data = dict(id=10, title='I am a banana!')
|
||||
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()
|
||||
if ensure:
|
||||
self.create_index(keys)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user