Loading poolpay/model/Card.py 0 → 100644 +21 −0 Original line number Diff line number Diff line from uuid import UUID from sqlalchemy.orm import Mapped, mapped_column from sqlalchemy.schema import ForeignKey from poolpay.model.Retrievable import Retrievable class Card(Retrievable): """ A card, most likely a pool card. It has an id (which is read from the card), and belongs to a person. """ __tablename__ = "card" id: Mapped[int] = mapped_column(primary_key=True) owner_uuid: Mapped[UUID] = mapped_column(ForeignKey("person.uuid")) @property def primary_key(self) -> int: return self.id Loading
poolpay/model/Card.py 0 → 100644 +21 −0 Original line number Diff line number Diff line from uuid import UUID from sqlalchemy.orm import Mapped, mapped_column from sqlalchemy.schema import ForeignKey from poolpay.model.Retrievable import Retrievable class Card(Retrievable): """ A card, most likely a pool card. It has an id (which is read from the card), and belongs to a person. """ __tablename__ = "card" id: Mapped[int] = mapped_column(primary_key=True) owner_uuid: Mapped[UUID] = mapped_column(ForeignKey("person.uuid")) @property def primary_key(self) -> int: return self.id