|
|
@@ -381,6 +381,8 @@ class AbstractCountry(models.Model):
|
|
381
|
381
|
primary_key=True)
|
|
382
|
382
|
iso_3166_1_a3 = models.CharField(_('ISO 3166-1 alpha-3'), max_length=3,
|
|
383
|
383
|
null=True, db_index=True)
|
|
|
384
|
+ # This should have been a CharField as it needs to be padded with zeros to
|
|
|
385
|
+ # be 3 digits. Access via the numeric_code instead.
|
|
384
|
386
|
iso_3166_1_numeric = models.PositiveSmallIntegerField(
|
|
385
|
387
|
_('ISO 3166-1 numeric'), null=True, db_index=True)
|
|
386
|
388
|
name = models.CharField(_('Official name (CAPS)'), max_length=128)
|
|
|
@@ -402,6 +404,10 @@ class AbstractCountry(models.Model):
|
|
402
|
404
|
def __unicode__(self):
|
|
403
|
405
|
return self.printable_name or self.name
|
|
404
|
406
|
|
|
|
407
|
+ @property
|
|
|
408
|
+ def numeric_code(self):
|
|
|
409
|
+ return u"%.03d" % self.iso_3166_1_numeric
|
|
|
410
|
+
|
|
405
|
411
|
|
|
406
|
412
|
class AbstractShippingAddress(AbstractAddress):
|
|
407
|
413
|
"""
|