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

Class Collection

backend/src/flashcards/models.py:11–21  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9
10
11class Collection(SQLModel, table=True):
12 id: uuid.UUID | None = Field(default_factory=uuid.uuid4, primary_key=True)
13 name: str = Field(index=True)
14 user_id: uuid.UUID = Field(foreign_key="user.id", index=True, ondelete="CASCADE")
15 user: "User" = Relationship(back_populates="collections")
16 cards: list["Card"] = Relationship(back_populates="collection", cascade_delete=True)
17 created_at: datetime = Field(default_factory=lambda: datetime.now(timezone.utc))
18 updated_at: datetime = Field(default_factory=lambda: datetime.now(timezone.utc))
19 practice_sessions: list["PracticeSession"] = Relationship(
20 back_populates="collection", sa_relationship_kwargs={"cascade": "all, delete"}
21 )
22
23
24class Card(SQLModel, table=True):

Callers 5

test_collectionFunction · 0.90
multiple_collectionsFunction · 0.90
_createFunction · 0.90
_createFunction · 0.90
create_collectionFunction · 0.70

Calls

no outgoing calls

Tested by 4

test_collectionFunction · 0.72
multiple_collectionsFunction · 0.72
_createFunction · 0.72
_createFunction · 0.72