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

Function get_collections

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

Source from the content-addressed store, hash-verified

23
24
25def get_collections(
26 session: Session, user_id: uuid.UUID, skip: int = 0, limit: int = 100
27) -> tuple[list[Collection], int]:
28 count_statement = select(func.count()).where(Collection.user_id == user_id)
29 count = session.exec(count_statement).one()
30 statement = (
31 select(Collection)
32 .where(Collection.user_id == user_id)
33 .order_by(Collection.updated_at.desc())
34 .offset(skip)
35 .limit(limit)
36 )
37 collections = session.exec(statement).all()
38 return collections, count
39
40
41def get_collection(

Callers 3

test_get_collectionsFunction · 0.90
test_get_collection_skipFunction · 0.90

Calls

no outgoing calls

Tested by 3

test_get_collectionsFunction · 0.72
test_get_collection_skipFunction · 0.72