git://git.onelab.eu
/
sfa.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Handle slice table update upon creation of a job.
[sfa.git]
/
sfa
/
senslab
/
slabpostgres.py
diff --git
a/sfa/senslab/slabpostgres.py
b/sfa/senslab/slabpostgres.py
index
f24d0b8
..
ac9f994
100644
(file)
--- a/
sfa/senslab/slabpostgres.py
+++ b/
sfa/senslab/slabpostgres.py
@@
-199,6
+199,7
@@
class SlabDB:
"""
#Creates the values string for the update SQL command
"""
#Creates the values string for the update SQL command
+ vclause = valueclause
if len(column_names) is not len(values):
return
else:
if len(column_names) is not len(values):
return
else:
@@
-206,12
+207,14
@@
class SlabDB:
valuesdict = dict(zip(column_names,values))
for k in valuesdict.keys():
valuesdict[k] = str(valuesdict[k])
valuesdict = dict(zip(column_names,values))
for k in valuesdict.keys():
valuesdict[k] = str(valuesdict[k])
- v = ' \''+ str(k) + '\''+ '='+' \''+ valuesdict[k]+'\''
+ #v = ' \''+ str(k) + '\''+ '='+' \''+ valuesdict[k]+'\''
+ v = str(k) + '=' + valuesdict[k]
valueslist.append(v)
valueslist.append(v)
-
+ if isinstance(vclause,str):
+ vclause = '\''+ vclause + '\''
statement = "UPDATE %s SET %s WHERE %s = %s" % \
statement = "UPDATE %s SET %s WHERE %s = %s" % \
- (table, ", ".join(valueslist), whereclause, v
alue
clause)
-
+ (table, ", ".join(valueslist), whereclause, vclause)
+ print>>sys.stderr,"\r\n \r\n SLABPOSTGRES.PY update statement %s valuesdict %s valueslist %s" %(statement,valuesdict,valueslist)
mark = self.cursor()
mark.execute(statement)
self.connection.commit()
mark = self.cursor()
mark.execute(statement)
self.connection.commit()