web/lib/django/contrib/gis/db/models/aggregates.py
changeset 29 cc9b7e14412b
parent 0 0d40e90630ef
--- a/web/lib/django/contrib/gis/db/models/aggregates.py	Wed May 19 17:43:59 2010 +0200
+++ b/web/lib/django/contrib/gis/db/models/aggregates.py	Tue May 25 02:43:45 2010 +0200
@@ -1,31 +1,17 @@
 from django.db.models import Aggregate
-from django.contrib.gis.db.backend import SpatialBackend
 from django.contrib.gis.db.models.sql import GeomField
 
-class GeoAggregate(Aggregate):
-
-    def add_to_query(self, query, alias, col, source, is_summary):
-        if hasattr(source, 'geom_type'):
-            # Doing additional setup on the Query object for spatial aggregates.
-            aggregate = getattr(query.aggregates_module, self.name)
-            
-            # Adding a conversion class instance and any selection wrapping
-            # SQL (e.g., needed by Oracle).
-            if aggregate.conversion_class is GeomField:
-                query.extra_select_fields[alias] = GeomField()
-                if SpatialBackend.select:
-                    query.custom_select[alias] = SpatialBackend.select
-     
-        super(GeoAggregate, self).add_to_query(query, alias, col, source, is_summary)
-
-class Collect(GeoAggregate):
+class Collect(Aggregate):
     name = 'Collect'
 
-class Extent(GeoAggregate):
+class Extent(Aggregate):
     name = 'Extent'
 
-class MakeLine(GeoAggregate):
+class Extent3D(Aggregate):
+    name = 'Extent3D'
+
+class MakeLine(Aggregate):
     name = 'MakeLine'
 
-class Union(GeoAggregate):
+class Union(Aggregate):
     name = 'Union'