"""
import sys
-import psycopg2
-import psycopg2.extras
-def getcursor():
- con = psycopg2.connect(database='note')
- cur = con.cursor(cursor_factory=psycopg2.extras.DictCursor)
- return con, cur
+import base
def get_sum(descriptions, debut, fin):
"""
AND montant != 0
AND description = ANY (%(descriptions)s);
"""
- con, cur = getcursor()
+ con, cur = base.getcursor()
cur.execute(req, {"debut" : debut + ' 00:00:00', "fin" : fin + ' 00:00:00', "descriptions" : descriptions})
s = cur.fetchone()["s"] or 0
return s