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

Add a "transactions" backref to User

This commit is contained in:
Steffo 2020-03-27 18:06:31 +01:00
parent 3e49f7c8a5
commit 7f4087e046

View file

@ -149,7 +149,7 @@ class Transaction(TableDeclarativeBase):
transaction_id = Column(Integer, primary_key=True)
# The user whose credit is affected by this transaction
user_id = Column(BigInteger, ForeignKey("users.user_id"), nullable=False)
user = relationship("User")
user = relationship("User", backref=backref("transactions"))
# The value of this transaction. Can be both negative and positive.
value = Column(Integer, nullable=False)
# Refunded status: if True, ignore the value of this transaction when recalculating