fix search routes insert txt address points
This commit is contained in:
SDE
2023-09-16 16:19:22 +03:00
parent 636d97250b
commit bae7e05077
4 changed files with 40 additions and 18 deletions

View File

@@ -75,26 +75,18 @@ class Route(BaseModel):
ordering = ('name',)
def from_country_n_city_str(self):
country = 'Неизвестно'
res = 'Неизвестно'
if self.from_city:
city = self.from_city.name
if self.from_city.country:
country = self.from_city.country
else:
city = 'Неизвестно'
res = self.from_city.get_country_n_city_str()
return f'{city} / {country}'
return res
def to_country_n_city_str(self):
country = 'Неизвестно'
res = 'Неизвестно'
if self.to_city:
city = self.to_city.name
if self.to_city.country:
country = self.to_city.country
else:
city = 'Неизвестно'
res = self.to_city.get_country_n_city_str()
return f'{city} / {country}'
return res
def get_address_points(self):