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
|
||||
|
||||
|
||||
@@ -11,12 +11,12 @@
|
||||
<div class="clear_both"></div>
|
||||
</div>
|
||||
<div class="from-to-country-container-carrier">
|
||||
<div class="from-to-country-text left fl-left txt-al-right" title="{% if route.from_country %}{{ route.from_country }}{% else %}Неизвестно{% endif %} / {% if route.from_city %}{{ route.from_city }}{% else %}Неизвестно{% endif %}">
|
||||
{% if route.from_country %}{{ route.from_country }}{% else %}Неизвестно{% endif %} / {% if route.from_city %}{{ route.from_city }}{% else %}Неизвестно{% endif %}
|
||||
<div class="from-to-country-text left fl-left txt-al-right" title="{{ route.from_country_n_city_str }}">
|
||||
{{ route.from_country_n_city_str }}
|
||||
</div>
|
||||
<div class="splitter-from-to-country"></div>
|
||||
<div class="from-to-country-text right fl-right txt-al-left" title="{% if route.to_country %}{{ route.to_country }}{% else %}Неизвестно{% endif %} / {% if route.to_city %}{{ route.to_city }}{% else %}Неизвестно{% endif %}">
|
||||
{% if route.to_country %}{{ route.to_country }}{% else %}Неизвестно{% endif %} / {% if route.to_city %}{{ route.to_city }}{% else %}Неизвестно{% endif %}
|
||||
<div class="from-to-country-text right fl-right txt-al-left" title="{{ route.to_country_n_city_str }}">
|
||||
{{ route.to_country_n_city_str }}
|
||||
</div>
|
||||
</div>
|
||||
{% include "small_INCLUDES/carrier_card/inf_about_moving.html" %}
|
||||
|
||||
@@ -31,12 +31,12 @@
|
||||
|
||||
</div>
|
||||
<div class="from-to-country-container-carrier">
|
||||
<div class="from-to-country-text left fl-left txt-al-right" title="{% if route.from_country %}{{ route.from_country }}{% else %}Неизвестно{% endif %} / {% if route.from_city %}{{ route.from_city }}{% else %}Неизвестно{% endif %}">
|
||||
{% if route.from_country %}{{ route.from_country }}{% else %}Неизвестно{% endif %} / {% if route.from_city %}{{ route.from_city }}{% else %}Неизвестно{% endif %}
|
||||
<div class="from-to-country-text left fl-left txt-al-right" title="{{ route.from_country_n_city_str }}">
|
||||
{{ route.from_country_n_city_str }}
|
||||
</div>
|
||||
<div class="splitter-from-to-country"></div>
|
||||
<div class="from-to-country-text right fl-right txt-al-left" title="{% if route.to_country %}{{ route.to_country }}{% else %}Неизвестно{% endif %} / {% if route.to_city %}{{ route.to_city }}{% else %}Неизвестно{% endif %}">
|
||||
{% if route.to_country %}{{ route.to_country }}{% else %}Неизвестно{% endif %} / {% if route.to_city %}{{ route.to_city }}{% else %}Неизвестно{% endif %}
|
||||
<div class="from-to-country-text right fl-right txt-al-left" title="{{ route.to_country_n_city_str }}">
|
||||
{{ route.to_country_n_city_str }}
|
||||
</div>
|
||||
</div>
|
||||
{% include "small_INCLUDES/carrier_card/inf_about_moving.html" %}
|
||||
|
||||
Reference in New Issue
Block a user