Merge pull request #23 from abelsonlive/master

allow keys arg for upsert to be a string
This commit is contained in:
gka 2013-08-11 01:55:44 -07:00
commit b14b73e320

View File

@ -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)