Replaced querying the currencies later with the "selectinload" query option in the journal and search reports.

This commit is contained in:
2023-03-09 07:39:07 +08:00
parent 672fcbcbdf
commit a14ffa93ed
2 changed files with 5 additions and 7 deletions

View File

@ -69,7 +69,8 @@ class EntryCollector:
pass
conditions.append(sa.or_(*sub_conditions))
return [ReportEntry(x) for x in JournalEntry.query.filter(*conditions)
.options(selectinload(JournalEntry.account))]
.options(selectinload(JournalEntry.account),
selectinload(JournalEntry.currency))]
@staticmethod
def __get_account_condition(k: str) -> sa.Select: