cities return both the zip code and their name

Since some cities have multiple zip codes it's necessary that they
return both the zip code and the name.
This commit is contained in:
Andreas Zweili 2017-12-12 20:32:57 +01:00
parent 5e8e4af2e7
commit 83bb342383
1 changed files with 1 additions and 1 deletions

View File

@ -111,7 +111,7 @@ class City(models.Model):
zip_code = models.PositiveSmallIntegerField()
def __str__(self):
return self.name
return '{} {}'.format(self.zip_code, self.name)
class Meta:
verbose_name_plural = "Cities"