浏览代码

A bit of an evil hack to get around a limitation in oursql?

tags/v0.1^2
Ben Kurtovic 12 年前
父节点
当前提交
0a88f16411
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. +2
    -2
      earwigbot/tasks/drn_clerkbot.py

+ 2
- 2
earwigbot/tasks/drn_clerkbot.py 查看文件

@@ -215,9 +215,9 @@ class DRNClerkBot(Task):

def select_next_id(self, conn, column, table):
"""Return the next incremental ID for a case."""
query = "SELECT MAX(?) FROM ?"
query = "SELECT MAX(?) FROM {0}".format(table)
with conn.cursor() as cursor:
cursor.execute(query, (column, table))
cursor.execute(query, (column,))
current = cursor.fetchone()[0]
if current:
return current + 1


正在加载...
取消
保存