Пример #1
0
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())
Пример #2
0
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()]