def filter_todo(filter = "", category = ""):
import sqlite3
conn = sqlite3.connect("lab.db")
cur = conn.cursor()
sql = ""
if len(category)>0 :
if filter == "f":
sql = "SELECT * from todo where finished = 1 and Category = category"
else :
sql = "SELECT * from todo where Category = category"
else :
if filter == "f":
sql = "SELECT * from todo where finished = 1"
else :
sql = "SELECT * from todo where 1"
cur.execute(sql)
rows = cur.fetchall()
conn.close()
return rows
도대체 뭘 하라는 건지 잘 모르겠다..
댓글 0