show nearby locations
This commit is contained in:
parent
3134829cc7
commit
27b35a384d
7 changed files with 68 additions and 19 deletions
|
@ -283,6 +283,7 @@ class CustomLocation:
|
|||
('grid_square', self.grid_square),
|
||||
('near_area', self.near_area.pk if self.near_area else None),
|
||||
('near_poi', self.near_poi.pk if self.near_poi else None),
|
||||
('nearby', tuple(location.pk for location in self.nearby)),
|
||||
('altitude', None if self.altitude is None else round(self.altitude, 2))
|
||||
))
|
||||
if not grid.enabled:
|
||||
|
@ -378,6 +379,10 @@ class CustomLocation:
|
|||
def near_poi(self):
|
||||
return self.description.near_poi
|
||||
|
||||
@cached_property
|
||||
def nearby(self):
|
||||
return self.description.nearby
|
||||
|
||||
@cached_property
|
||||
def grid_square(self):
|
||||
return grid.get_square_for_point(self.x, self.y) or ''
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue