MCPcopy Create free account
hub / github.com/0010aor/FlashNotes / get_practice_sessions

Function get_practice_sessions

backend/src/flashcards/services.py:197–210  ·  view source on GitHub ↗
(
    session: Session, user_id: uuid.UUID, skip: int = 0, limit: int = 100
)

Source from the content-addressed store, hash-verified

195
196
197def get_practice_sessions(
198 session: Session, user_id: uuid.UUID, skip: int = 0, limit: int = 100
199) -> tuple[list["PracticeSession"], int]:
200 count_statement = select(func.count()).where(PracticeSession.user_id == user_id)
201 count = session.exec(count_statement).one()
202 statement = (
203 select(PracticeSession)
204 .where(PracticeSession.user_id == user_id)
205 .order_by(PracticeSession.created_at.desc())
206 .offset(skip)
207 .limit(limit)
208 )
209 practice_sessions = session.exec(statement).all()
210 return practice_sessions, count
211
212
213def get_practice_session(

Calls

no outgoing calls

Tested by 2