Django

Code

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

Revision 10197, 1.7 kB (checked in by jbronn, 3 months ago)

Refactored and cleaned up parts of the spatial database backend. Changes include:

* Laid foundations for SpatiaLite? support in GeoQuerySet, GeoWhereNode and the tests.
* Added the Collect aggregate for PostGIS (still needs tests).
* Oracle now goes to 11.
* The backend-specific SpatialRefSys and GeometryColumns models are now attributes of SpatialBackend.
* Renamed GeometryField attributes to be public that were private (e.g., _srid -> srid and _geom -> geom_type).
* Renamed create_test_db to create_test_spatial_db.
* Removed the legacy classes GeoMixin and GeoQ.
* Removed evil \ from spatial backend fields.
* Moved shapefile data from tests/layermap to tests/data.

Fixed #9794. Refs #9686.

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