From 1140d9c896c679757fef701a9f5c8a8a067f5559 Mon Sep 17 00:00:00 2001 From: Herculino Trotta Date: Wed, 29 Jan 2025 13:46:06 -0300 Subject: [PATCH] feat: improve transactions list loading time Prefetch more values and allow them to be cached --- app/apps/monthly_overview/views.py | 3 +++ app/apps/transactions/views/transactions.py | 3 +++ 2 files changed, 6 insertions(+) diff --git a/app/apps/monthly_overview/views.py b/app/apps/monthly_overview/views.py index 73933e1..cc68231 100644 --- a/app/apps/monthly_overview/views.py +++ b/app/apps/monthly_overview/views.py @@ -84,9 +84,12 @@ def transactions_list(request, month: int, year: int): "account__group", "category", "tags", + "tags__id", "account__exchange_currency", "account__currency", "installment_plan", + "entities__name", + "entities__id", ) ) diff --git a/app/apps/transactions/views/transactions.py b/app/apps/transactions/views/transactions.py index 23c9ec8..b186f41 100644 --- a/app/apps/transactions/views/transactions.py +++ b/app/apps/transactions/views/transactions.py @@ -336,9 +336,12 @@ def transaction_all_list(request): "account__group", "category", "tags", + "tags__id", "account__exchange_currency", "account__currency", "installment_plan", + "entities__name", + "entities__id", ).all() transactions = default_order(transactions, order=order)