Skip to content
This repository was archived by the owner on Oct 23, 2019. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion marketpulse/main/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from django.conf import settings
from django.core.validators import MinValueValidator

from django_countries import countries
from django_countries.fields import CountryField
from uuslug import uuslug

Expand Down Expand Up @@ -66,7 +67,12 @@ class Carrier(models.Model):
country = CountryField(null=True, blank=True)

def __unicode__(self):
return self.name
all_countries = dict(countries)
country = self.country
if self.country.code in all_countries:
country = all_countries[self.country.code]

return '{0}, {1}, {2}'.format(self.name, country, self.parent_operator)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to show self.parent_operator? It might lead to lengthy strings and it will not show up correctly in the menu.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If that works fine locally, feel free to keep it.



class Plan(models.Model):
Expand Down