Skip to content

Commit

Permalink
feat(project): replace combined_emprise by land mpoly
Browse files Browse the repository at this point in the history
  • Loading branch information
alexisig committed Nov 5, 2024
1 parent bc1edfd commit 9113912
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions project/models/project_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,16 +77,7 @@ class Status(models.TextChoices):

@property
def combined_emprise(self) -> MultiPolygon:
cache_key = f"project/{self.id}/combined_emprise"
if cache.has_key(cache_key):
return cache.get(cache_key)
combined = self.emprise_set.aggregate(Union("mpoly"))
if "mpoly__union" in combined:
result = combined["mpoly__union"]
else:
result = MultiPolygon()
cache.set(cache_key, result)
return result
return self.land.mpoly

def __str__(self):
return self.name
Expand Down

0 comments on commit 9113912

Please sign in to comment.