Browse Source

cursor.executemany(), not cursor.execute().

tags/v0.1^2
Ben Kurtovic 12 years ago
parent
commit
c0302dc800
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      earwigbot/tasks/drn_clerkbot.py

+ 2
- 2
earwigbot/tasks/drn_clerkbot.py View File

@@ -416,14 +416,14 @@ class DRNClerkBot(Task):
additions = set(sigs) - set(storedsigs) additions = set(sigs) - set(storedsigs)
if removals: if removals:
args = [(case.id, name, stamp) for (name, stamp) in removals] args = [(case.id, name, stamp) for (name, stamp) in removals]
cursor.execute(query1, args)
cursor.executemany(query1, args)
if additions: if additions:
nextid = self.select_next_id(conn, "signature_id", "signatures") nextid = self.select_next_id(conn, "signature_id", "signatures")
args = [] args = []
for name, stamp in additions: for name, stamp in additions:
args.append((nextid, case.id, name, stamp)) args.append((nextid, case.id, name, stamp))
nextid += 1 nextid += 1
cursor.execute(query2, args)
cursor.executemany(query2, args)


def save_new_case(self, conn, case): def save_new_case(self, conn, case):
args = (case.id, case.title, case.status, case.last_action, args = (case.id, case.title, case.status, case.last_action,


Loading…
Cancel
Save