You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
579 B
Python
24 lines
579 B
Python
2 years ago
|
from __future__ import unicode_literals
|
||
|
|
||
|
from django.utils.encoding import python_2_unicode_compatible
|
||
|
from django.db import models
|
||
|
|
||
|
__all__ = ('Country',)
|
||
|
|
||
|
@python_2_unicode_compatible
|
||
|
class Country(models.Model):
|
||
|
iso = models.CharField(max_length=2, primary_key=True)
|
||
|
name = models.CharField('Country name', max_length=128)
|
||
|
|
||
|
class Meta:
|
||
|
verbose_name = 'country'
|
||
|
verbose_name_plural = 'countries'
|
||
|
db_table = 'nano_country'
|
||
|
|
||
|
@property
|
||
|
def printable_name(self):
|
||
|
return self.name
|
||
|
|
||
|
def __str__(self):
|
||
|
return self.name
|