Skip to content

Commit

Permalink
fix orderitem-order relation warning
Browse files Browse the repository at this point in the history
  • Loading branch information
valentino-sm authored and Steffo99 committed May 6, 2021
1 parent 6a70a45 commit 262eea2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions database.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"
Expand Down

1 comment on commit 262eea2

@jsramirezch

This comment was marked as off-topic.

Please sign in to comment.