MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / User

Class User

test/typing/plain_files/orm/relationship.py:46–62  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44
45
46class User(Base):
47 __tablename__ = "user"
48
49 id: Mapped[int] = mapped_column(primary_key=True)
50 name: Mapped[str] = mapped_column()
51 group_id = mapped_column(ForeignKey("group.id"))
52
53 # this currently doesn't generate an error. not sure how to get the
54 # overloads to hit this one, nor am i sure i really want to do that
55 # anyway
56 name_this_works_atm: Mapped[str] = mapped_column(nullable=True)
57
58 extra: Mapped[Optional[str]] = mapped_column()
59 extra_name: Mapped[Optional[str]] = mapped_column("extra_name")
60
61 addresses_style_one: Mapped[List["Address"]] = relationship()
62 addresses_style_two: Mapped[Set["Address"]] = relationship()
63
64
65class Address(Base):

Callers

nothing calls this directly

Calls 3

mapped_columnFunction · 0.90
ForeignKeyClass · 0.90
relationshipFunction · 0.90

Tested by

no test coverage detected