Django

Code

Show
Ignore:
Timestamp:
02/10/08 20:25:01 (10 months ago)
Author:
jbronn
Message:

gis: Fixed 6414, and applied DRY to spatial backend internals. Changes include:

(1) Support for distance calculations on geometry fields with geodetic coordinate systems (e.g., WGS84, the default).
(2) The get_db_prep_save and get_db_prep_lookup have been moved from the spatial backends to common implementations in GeometryField.
(3) Simplified SQL construction for GeoQuerySet methods.
(4) SpatialBackend now contains all spatial backend dependent settings.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/branches/gis/django/contrib/gis/tests/distapp/models.py

    r6886 r7104  
    11from django.contrib.gis.db import models 
    22 
    3 class City(models.Model): 
     3class SouthTexasCity(models.Model): 
     4    "City model on projected coordinate system for South Texas." 
    45    name = models.CharField(max_length=30) 
    56    point = models.PointField(srid=32140) 
     7    objects = models.GeoManager() 
     8    def __unicode__(self): return self.name 
     9 
     10class AustraliaCity(models.Model): 
     11    "City model for Australia, using WGS84." 
     12    name = models.CharField(max_length=30) 
     13    point = models.PointField() 
    614    objects = models.GeoManager() 
    715    def __unicode__(self): return self.name 
     
    1119#    mpoly = models.MultiPolygonField(srid=32140) 
    1220#    objects = models.GeoManager() 
    13  
    14 city_mapping = {'name' : 'Name', 
    15                 'point' : 'POINT', 
    16                 } 
    17  
    18 #county_mapping = {'name' : 'Name', 
    19 #                  'mpoly' : 'MULTIPOLYGON', 
    20 #                  }