Replaced querying the accounts later with the "selectinload" query option in the journal and search reports, and restored the lazy setting in the account relationship of the JournalEntry data model.

This commit is contained in:
2023-03-09 07:21:01 +08:00
parent 21b3320e66
commit 13e3ef5875
4 changed files with 48 additions and 47 deletions

View File

@ -617,7 +617,7 @@ class JournalEntry(db.Model):
onupdate="CASCADE"),
nullable=False)
"""The account ID."""
account = db.relationship(Account, back_populates="entries")
account = db.relationship(Account, back_populates="entries", lazy=False)
"""The account."""
summary = db.Column(db.String, nullable=True)
"""The summary."""