feat: Show position of shelter on the map

This commit is contained in:
2025-01-06 08:36:51 +01:00
parent ab837ee80e
commit e3833b4505
4 changed files with 90 additions and 44 deletions

View File

@@ -13,7 +13,7 @@ from django.contrib.auth.models import AbstractUser
from .tools import misc, geo
from notfellchen.settings import MEDIA_URL
from .tools.geo import LocationProxy
from .tools.geo import LocationProxy, Position
from .tools.misc import age_as_hr_string, time_since_as_hr_string
@@ -134,6 +134,14 @@ class RescueOrganization(models.Model):
def adoption_notices(self):
return AdoptionNotice.objects.filter(organization=self)
@property
def position(self):
if self.location:
return Position(latitude=self.location.latitude, longitude=self.location.longitude)
else:
return None
# Admins can perform all actions and have the highest trust associated with them
# Moderators can make moderation decisions regarding the deletion of content