Source code for sidequest_common.models.talents

 1"""Talent builds members save from the talent calculator, and the ones officers pin for raids."""
 2
 3from advanced_alchemy.base import UUIDAuditBase
 4from sqlalchemy import BigInteger, Boolean, ForeignKey, String, Text
 5from sqlalchemy.orm import Mapped, mapped_column
 6
 7
[docs] 8class TalentBuild(UUIDAuditBase): 9 """One saved talent build for a class. 10 11 ``code`` holds the points per talent, one digit per talent node in tree order and the three trees joined by 12 ``-`` (the calculator's own encoding, which is also its share link). ``pinned`` marks a build officers recommend 13 for raids; members see pinned builds next to their own. 14 """ 15 16 __tablename__ = "talent_build" 17 __table_args__ = {"comment": "Talent calculator builds saved by members; officers pin raid builds."} 18 19 member_id: Mapped[int] = mapped_column(BigInteger, ForeignKey("member.id", ondelete="CASCADE"), index=True) 20 wow_class: Mapped[str] = mapped_column(String(20), index=True) 21 name: Mapped[str] = mapped_column(Text) 22 code: Mapped[str] = mapped_column(Text) 23 note: Mapped[str | None] = mapped_column(Text, default=None) 24 pinned: Mapped[bool] = mapped_column(Boolean, default=False, index=True)