feat: Use truncated location
This commit is contained in:
parent
9f977e35c2
commit
c3dd9faa85
@ -121,6 +121,10 @@ class Location(models.Model):
|
|||||||
def __str__(self):
|
def __str__(self):
|
||||||
return f"{self.name} ({self.latitude:.5}, {self.longitude:.5})"
|
return f"{self.name} ({self.latitude:.5}, {self.longitude:.5})"
|
||||||
|
|
||||||
|
@property
|
||||||
|
def str_hr(self):
|
||||||
|
return f"{self.name.split(',')[0]}"
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def get_location_from_string(location_string):
|
def get_location_from_string(location_string):
|
||||||
geo_api = geo.GeoAPI()
|
geo_api = geo.GeoAPI()
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
<p>
|
<p>
|
||||||
<b>Ort</b>
|
<b>Ort</b>
|
||||||
{% if adoption_notice.location %}
|
{% if adoption_notice.location %}
|
||||||
{{ adoption_notice.location }}
|
{{ adoption_notice.location.str_hr }}
|
||||||
{% else %}
|
{% else %}
|
||||||
{{ adoption_notice.location_string }}
|
{{ adoption_notice.location_string }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
<p>
|
<p>
|
||||||
<b>Ort</b>
|
<b>Ort</b>
|
||||||
{% if adoption_notice.location %}
|
{% if adoption_notice.location %}
|
||||||
{{ adoption_notice.location }}
|
{{ adoption_notice.location.str_hr }}
|
||||||
{% else %}
|
{% else %}
|
||||||
{{ adoption_notice.location_string }}
|
{{ adoption_notice.location_string }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
Loading…
Reference in New Issue
Block a user