2008-08-06 02:13:06 +08:00
|
|
|
from django.contrib.gis.db import models
|
2008-09-02 06:15:35 +08:00
|
|
|
from django.contrib.localflavor.us.models import USStateField
|
2008-08-06 02:13:06 +08:00
|
|
|
|
|
|
|
class Location(models.Model):
|
|
|
|
name = models.CharField(max_length=50)
|
|
|
|
point = models.PointField()
|
|
|
|
objects = models.GeoManager()
|
|
|
|
|
|
|
|
class City(models.Model):
|
|
|
|
name = models.CharField(max_length=50)
|
2008-09-02 06:15:35 +08:00
|
|
|
state = USStateField()
|
2008-08-06 02:13:06 +08:00
|
|
|
location = models.ForeignKey(Location)
|
|
|
|
objects = models.GeoManager()
|
2008-12-06 09:52:14 +08:00
|
|
|
|
|
|
|
class AugmentedLocation(Location):
|
|
|
|
extra_text = models.TextField(blank=True)
|
|
|
|
objects = models.GeoManager()
|
|
|
|
|
|
|
|
class DirectoryEntry(models.Model):
|
|
|
|
listing_text = models.CharField(max_length=50)
|
|
|
|
location = models.ForeignKey(AugmentedLocation)
|
|
|
|
objects = models.GeoManager()
|