Skip to content

Commit

Permalink
Merge pull request #4278 from GeotrekCE/perfs_add_query_optims
Browse files Browse the repository at this point in the history
⚡ [PERF] Optimize Path Aggregation query in detail view
  • Loading branch information
Chatewgne authored Sep 16, 2024
2 parents 6333ad8 + 2003433 commit 5237070
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ CHANGELOG
**Improvements**

- ApidaeTrekParser now imports all features from GPX
- Optimize path aggregations query in detail view

**Minor fixes**

Expand Down
2 changes: 1 addition & 1 deletion geotrek/core/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 5237070

Please sign in to comment.