0.7.25
country_n_city_str
This commit is contained in:
@@ -74,6 +74,29 @@ class Route(BaseModel):
|
||||
verbose_name_plural = _(u'Маршруты')
|
||||
ordering = ('name',)
|
||||
|
||||
def from_country_n_city_str(self):
|
||||
country = 'Неизвестно'
|
||||
if self.from_city:
|
||||
city = self.from_city.name
|
||||
if self.from_city.country:
|
||||
country = self.from_city.country
|
||||
else:
|
||||
city = 'Неизвестно'
|
||||
|
||||
return f'{city} / {country}'
|
||||
|
||||
def to_country_n_city_str(self):
|
||||
country = 'Неизвестно'
|
||||
if self.to_city:
|
||||
city = self.to_city.name
|
||||
if self.to_city.country:
|
||||
country = self.to_city.country
|
||||
else:
|
||||
city = 'Неизвестно'
|
||||
|
||||
return f'{city} / {country}'
|
||||
|
||||
|
||||
def get_address_points(self):
|
||||
from ReferenceDataApp.models import Airport, City
|
||||
|
||||
|
||||
Reference in New Issue
Block a user