feat: make display of location nicer

This commit is contained in:
moanos [he/him] 2025-05-09 21:03:21 +02:00
parent eb930b71d6
commit 8641bead80

View File

@ -58,6 +58,9 @@ class Location(models.Model):
created_at = models.DateTimeField(auto_now_add=True)
def __str__(self):
if self.city and self.postcode:
return f"{self.city} ({self.postcode})"
else:
return f"{self.name} ({self.latitude:.5}, {self.longitude:.5})"
@property