app/django/contrib/gis/tests/relatedapp/models.py
author Lennard de Rijk <ljvderijk@gmail.com>
Sat, 31 Jan 2009 12:36:06 +0000
changeset 1104 02997d6661fa
parent 323 ff1a9aa48cfd
permissions -rw-r--r--
Added a Create a New Program link to the Program Owners's menu. Patch by: Lennard de Rijk Reviewed by: to-be-reviewed

from django.contrib.gis.db import models
from django.contrib.localflavor.us.models import USStateField

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)
    state = USStateField()
    location = models.ForeignKey(Location)
    objects = models.GeoManager()