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

https://code.google.com/p/mango-py/ · Python · 50 lines · 43 code · 7 blank · 0 comment · 0 complexity · dfdabec5cb3ce0fdacefcafb5d1df3ab MD5 · raw file

  1. from django.contrib.gis.db import models
  2. class SouthTexasCity(models.Model):
  3. "City model on projected coordinate system for South Texas."
  4. name = models.CharField(max_length=30)
  5. point = models.PointField(srid=32140)
  6. objects = models.GeoManager()
  7. def __unicode__(self): return self.name
  8. class SouthTexasCityFt(models.Model):
  9. "Same City model as above, but U.S. survey feet are the units."
  10. name = models.CharField(max_length=30)
  11. point = models.PointField(srid=2278)
  12. objects = models.GeoManager()
  13. def __unicode__(self): return self.name
  14. class AustraliaCity(models.Model):
  15. "City model for Australia, using WGS84."
  16. name = models.CharField(max_length=30)
  17. point = models.PointField()
  18. objects = models.GeoManager()
  19. def __unicode__(self): return self.name
  20. class CensusZipcode(models.Model):
  21. "Model for a few South Texas ZIP codes (in original Census NAD83)."
  22. name = models.CharField(max_length=5)
  23. poly = models.PolygonField(srid=4269)
  24. objects = models.GeoManager()
  25. def __unicode__(self): return self.name
  26. class SouthTexasZipcode(models.Model):
  27. "Model for a few South Texas ZIP codes."
  28. name = models.CharField(max_length=5)
  29. poly = models.PolygonField(srid=32140, null=True)
  30. objects = models.GeoManager()
  31. def __unicode__(self): return self.name
  32. class Interstate(models.Model):
  33. "Geodetic model for U.S. Interstates."
  34. name = models.CharField(max_length=10)
  35. path = models.LineStringField()
  36. objects = models.GeoManager()
  37. def __unicode__(self): return self.name
  38. class SouthTexasInterstate(models.Model):
  39. "Projected model for South Texas Interstates."
  40. name = models.CharField(max_length=10)
  41. path = models.LineStringField(srid=32140)
  42. objects = models.GeoManager()
  43. def __unicode__(self): return self.name