(
session: Session, user_id: uuid.UUID, skip: int = 0, limit: int = 100
)
| 195 | |
| 196 | |
| 197 | def 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 | |
| 213 | def get_practice_session( |
no outgoing calls