MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / Child

Class Child

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

Source from the content-addressed store, hash-verified

54
55
56class Child(Base):
57 __tablename__ = "child"
58
59 name: Mapped[str] = mapped_column(primary_key=True)
60 parent_name: Mapped[str] = mapped_column(ForeignKey(Parent.name))
61
62 parent: Mapped[Parent] = relationship()
63
64
65assert get_parent_name(Child(parent=Parent(name="foo"))) == "foo"

Callers 1

Calls 3

mapped_columnFunction · 0.90
ForeignKeyClass · 0.90
relationshipFunction · 0.90

Tested by

no test coverage detected