MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / Order

Class Order

examples/association/basic_association.py:32–43  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

30
31
32class Order(Base):
33 __tablename__ = "order"
34
35 order_id: Mapped[int] = mapped_column(primary_key=True)
36 customer_name: Mapped[str] = mapped_column(String(30))
37 order_date: Mapped[datetime] = mapped_column(default=datetime.now())
38 order_items: Mapped[list[OrderItem]] = relationship(
39 cascade="all, delete-orphan", backref="order"
40 )
41
42 def __init__(self, customer_name: str) -> None:
43 self.customer_name = customer_name
44
45
46class Item(Base):

Callers 1

Calls 4

mapped_columnFunction · 0.90
StringClass · 0.90
relationshipFunction · 0.90
nowMethod · 0.80

Tested by

no test coverage detected