def lookup_vote_by_votename(votename: str) -> Vote: with DBCursor(database) as c: c.execute('SELECT * FROM votes WHERE votename = ?', (votename, )) return Vote.from_database(c.fetchone())
def lookup_votes() -> List[Vote]: with DBCursor(database) as c: c.execute('SELECT * FROM votes') return [Vote.from_database(elem) for elem in c.fetchall()]