fixed store() (can't use sqlite ?-binding for column names in update), although it's never called yet

--HG--
extra : convert_revision : svn%3A41726ec3-264d-0410-9c23-a9f1637257cc/trunk%4029
This commit is contained in:
adrian.sampson 2008-06-25 21:14:03 +00:00
parent 6b113c8f6e
commit d6472584be

View file

@ -138,11 +138,13 @@ class Item(object):
store_id = self.id
# build assignments for query
assignments = ','.join( ['?=?'] * (len(item_fields)-1) )
assignments = ''
subvars = []
for key in item_keys:
if key != 'id':
subvars += [key, self.record[key]]
assignments += key + '=?,'
subvars.append(self.record[key])
assignments = assignments[:-1] # knock off last ,
# finish the query
query = 'update items set ' + assignments + ' where id=?'