From 2003433e23f7362561ac127c11ebd8102c6c5f24 Mon Sep 17 00:00:00 2001 From: Chatewgne Date: Thu, 22 Aug 2024 16:07:03 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9A=A1=20[PERF]=20Optimize=20Path=20Aggregat?= =?UTF-8?q?ion=20query=20in=20detail=20view?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/changelog.rst | 1 + geotrek/core/models.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index 05482ea765..51790785d4 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -8,6 +8,7 @@ CHANGELOG **Improvements** - ApidaeTrekParser now imports all features from GPX +- Optimize path aggregations query in detail view **Minor fixes** diff --git a/geotrek/core/models.py b/geotrek/core/models.py index 0bfd213c7e..c94ba7aa7c 100644 --- a/geotrek/core/models.py +++ b/geotrek/core/models.py @@ -781,7 +781,7 @@ def distance(self, to_cls): @property def aggregations_optimized(self): - return self.aggregations.all().select_related('path', 'topo_object') + return self.aggregations.all().select_related('path') class PathAggregation(models.Model):