From c26c4686c512bd18bafd0f50534ae0f737e0cf95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BE=9D=E7=91=AA=E8=B2=93?= Date: Fri, 10 Mar 2023 08:17:53 +0800 Subject: [PATCH] Renamed the "original_id" column to "offset_original_id", and the "original" and "offset" relationships to "offset_original" and "offsets", respectively, in the JournalEntry data model. --- src/accounting/models.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/accounting/models.py b/src/accounting/models.py index b46894f..b031ed9 100644 --- a/src/accounting/models.py +++ b/src/accounting/models.py @@ -597,14 +597,14 @@ class JournalEntry(db.Model): """True for a debit entry, or False for a credit entry.""" no = db.Column(db.Integer, nullable=False) """The entry number under the transaction and debit or credit.""" - original_id = db.Column(db.Integer, - db.ForeignKey(id, onupdate="CASCADE"), - nullable=True) - """The ID of the original entry when offsetting.""" - original = db.relationship("JournalEntry", back_populates="offset", - remote_side=id, passive_deletes=True) - """The original entry when offsetting.""" - offset = db.relationship("JournalEntry", back_populates="original") + offset_original_id = db.Column(db.Integer, + db.ForeignKey(id, onupdate="CASCADE"), + nullable=True) + """The ID of the original entry to offset.""" + offset_original = db.relationship("JournalEntry", back_populates="offsets", + remote_side=id, passive_deletes=True) + """The original entry to offset.""" + offsets = db.relationship("JournalEntry", back_populates="offset_original") """The offset entries.""" currency_code = db.Column(db.String, db.ForeignKey(Currency.code, onupdate="CASCADE"),