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:
parent
5e8e4af2e7
commit
83bb342383
|
@ -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"
|
||||
|
|
Loading…
Reference in New Issue