import data db = data.CON cur = db.cursor() class Utils(): def __init__(): pass def get_unique_people(): data = cur.execute('select distinct person from tasks;') ppl = data.fetchall() return ppl def get_specific_person(person): res = cur.execute(f"select verse,verse_passage,status from tasks where person='{person.value}'") dbinfo = res.fetchall() return dbinfo def toggle_completion(verse, person, status): ins = cur.execute(f"update tasks set status = '{status}' where person = '{person.value}' and verse = '{verse}'") db.commit() def get_persons_incomplete(person): inc = cur.execute(f"select person, verse, verse_passage, club from tasks where status = '0' and person = '{person}'") incret = inc.fetchall() return incret def edit_verse(person, verse, passage): print(f"update tasks set verse_passage = '{passage.value}' where person = '{person.value}' and verse = '{verse}'") vedit = cur.execute(f"update tasks set verse_passage = '{passage.value}' where person = '{person.value} and verse = '{verse}';") db.commit() def add_person(person): print(person) aperson = cur.execute(f"insert into tasks(person) values ('{person.value}')") db.commit() def delete_verse(verse, person): dverse = cur.execute(f"delete from tasks where person = '{person.value}' and verse = '{verse}'") db.commit()