diff mysite/band/models.py @ 5:e602b5302b94

Added support for countries beside the USA.
author Brian Neal <bgneal@gmail.com>
date Thu, 14 May 2009 00:31:39 +0000
parents 0dcfcdf50c62
children dac690ab98b2
line wrap: on
line diff
--- a/mysite/band/models.py	Sun Apr 19 18:36:56 2009 +0000
+++ b/mysite/band/models.py	Thu May 14 00:31:39 2009 +0000
@@ -60,6 +60,18 @@
 
 #######################################################################
 
+class Country(models.Model):
+    name = models.CharField(max_length=64)
+
+    class Meta:
+        ordering = ('name', )
+        verbose_name_plural = 'Countries'
+
+    def __unicode__(self):
+        return self.name
+
+#######################################################################
+
 class State(models.Model):
    name = models.CharField(max_length = 16)
    abbrev = USStateField()
@@ -75,6 +87,7 @@
 class City(models.Model):
    name = models.CharField(max_length = 50)
    state = models.ForeignKey(State, null = True, blank = True)
+   country = models.ForeignKey(Country, null=True, blank=True)
 
    class Meta:
       verbose_name_plural = 'Cities'