Exemplo n.º 1
0
def get_notes(user):
    with sqlite3.connect(Connection.db_path) as conn:
        conn.row_factory = model_factory(Note)
        db_cursor = conn.cursor()

        db_cursor.execute("""
        select
            n.id,
            n.name
        from binder_note n
        WHERE n.user_id = ?
        """, (user,))

        return db_cursor.fetchall()
Exemplo n.º 2
0
def get_classes(user):
    with sqlite3.connect(Connection.db_path) as conn:
        conn.row_factory = model_factory(SchoolClass)
        db_cursor = conn.cursor()

        db_cursor.execute("""
        select
            s.id,
            s.name
        from binder_schoolclass s
        WHERE s.user_id = ?
        """, (user,))

        return db_cursor.fetchall()