1
Fork 0
mirror of https://github.com/Steffo99/greed.git synced 2024-11-24 14:54:18 +00:00

fix orderitem-order relation warning

This commit is contained in:
valentino-sm 2021-05-06 08:42:22 +05:00 committed by Stefano Pigozzi
parent 6a70a45211
commit 262eea2b38

View file

@ -241,7 +241,7 @@ class Order(DeferredReflection, TableDeclarativeBase):
# Refund reason: if null, product hasn't been refunded
refund_reason = Column(Text)
# List of items in the order
items: typing.List["OrderItem"] = relationship("OrderItem")
items: typing.List["OrderItem"] = relationship("OrderItem", back_populates="order")
# Extra details specified by the purchasing user
notes = Column(Text)
# Linked transaction
@ -297,7 +297,7 @@ class OrderItem(DeferredReflection, TableDeclarativeBase):
product = relationship("Product")
# The order in which this item is being purchased
order_id = Column(Integer, ForeignKey("orders.order_id"), nullable=False)
order = relationship("Order")
order = relationship("Order", back_populates="items")
# Extra table parameters
__tablename__ = "orderitems"