2 questions from the last 30 days
4
votes
1
answer
102
views
How to aggregate hierarchical data efficiently in Django without causing N+1 queries?
I’m working with a hierarchical model structure in Django, where each level can represent a region, district, or village. The structure looks like this:
class Location(models.Model):
name = models....