PageRenderTime 301ms CodeModel.GetById 129ms app.highlight 12ms RepoModel.GetById 60ms app.codeStats 2ms

/django/contrib/gis/tests/geogapp/models.py

https://code.google.com/p/mango-py/
Python | 20 lines | 17 code | 3 blank | 0 comment | 0 complexity | 06ecb2a9fa8a798d5fdbb4a83d774120 MD5 | raw file
 1from django.contrib.gis.db import models
 2
 3class City(models.Model):
 4    name = models.CharField(max_length=30)
 5    point = models.PointField(geography=True)
 6    objects = models.GeoManager()
 7    def __unicode__(self): return self.name
 8
 9class Zipcode(models.Model):
10    code = models.CharField(max_length=10)
11    poly = models.PolygonField(geography=True)
12    objects = models.GeoManager()
13    def __unicode__(self): return self.code
14
15class County(models.Model):
16    name = models.CharField(max_length=25)
17    state = models.CharField(max_length=20)
18    mpoly = models.MultiPolygonField(geography=True)
19    objects = models.GeoManager()
20    def __unicode__(self): return ' County, '.join([self.name, self.state])