mirror of
https://github.com/Steffo99/greed.git
synced 2024-11-21 21:44:19 +00:00
fix order-transaction one-to-one relation #2
This commit is contained in:
parent
3f38083d3e
commit
3272557df7
1 changed files with 2 additions and 1 deletions
|
@ -181,6 +181,7 @@ class Transaction(DeferredReflection, TableDeclarativeBase):
|
|||
|
||||
# Order ID
|
||||
order_id = Column(Integer, ForeignKey("orders.order_id"))
|
||||
order = relationship("Order", back_populates="transaction")
|
||||
|
||||
# Extra table parameters
|
||||
__tablename__ = "transactions"
|
||||
|
@ -244,7 +245,7 @@ class Order(DeferredReflection, TableDeclarativeBase):
|
|||
# Extra details specified by the purchasing user
|
||||
notes = Column(Text)
|
||||
# Linked transaction
|
||||
transaction = relationship("Transaction", backref="order", uselist=False)
|
||||
transaction = relationship("Transaction", back_populates="order", uselist=False)
|
||||
|
||||
# Extra table parameters
|
||||
__tablename__ = "orders"
|
||||
|
|
Loading…
Reference in a new issue