<s> from django . contrib . gis . db . models . fields import ExtentField <EOL> from django . db . models . aggregates import Aggregate <EOL> __all__ = [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] <EOL> class GeoAggregate ( Aggregate ) : <EOL> function = None <EOL> is_extent = False <EOL> def as_sql ( self , compiler , connection ) : <EOL> connection . ops . check_expression_support ( self ) <EOL> self . function = connection . ops . spatial_aggregate_name ( self . name ) <EOL> return super ( GeoAggregate , self ) . as_sql ( compiler , connection ) <EOL> def as_oracle ( self , compiler , connection ) : <EOL> if not hasattr ( self , '<STR_LIT>' ) : <EOL> self . tolerance = <NUM_LIT> <EOL> self . extra [ '<STR_LIT>' ] = self . tolerance <EOL> if not self . is_extent : <EOL> self . template = '<STR_LIT>' <EOL> return self . as_sql ( compiler , connection ) <EOL> def resolve_expression ( self , query = None , allow_joins = True , reuse = None , summarize = False , for_save = False ) : <EOL> c = super ( GeoAggregate , self ) . resolve_expression ( query , allow_joins , reuse , summarize , for_save ) <EOL> for expr in c . get_source_expressions ( ) : <EOL> if not hasattr ( expr . field , '<STR_LIT>' ) : <EOL> raise ValueError ( '<STR_LIT>' ) <EOL> return c <EOL> def convert_value ( self , value , expression , connection , context ) : <EOL> return connection . ops . convert_geom ( value , self . output_field ) <EOL> class Collect ( GeoAggregate ) : <EOL> name = '<STR_LIT>' <EOL> class Extent ( GeoAggregate ) : <EOL> name = '<STR_LIT>' <EOL> is_extent = '<STR_LIT>' <EOL> def __init__ ( self , expression , ** extra ) : <EOL> super ( Extent , self ) . __init__ ( expression , output_field = ExtentField ( ) , ** extra ) <EOL> def convert_value ( self , value , expression , connection , context ) : <EOL> return connection . ops . convert_extent ( value , context . get ( '<STR_LIT>' ) ) <EOL> class Extent3D ( GeoAggregate ) : <EOL> name = '<STR_LIT>' <EOL> is_extent = '<STR_LIT>' <EOL> def __init__ ( self , expression , ** extra ) : <EOL> super ( Extent3D , self ) . __init__ ( expression , output_field = ExtentField ( ) , ** extra ) <EOL> def convert_value ( self , value , expression , connection , context ) : <EOL> return connection . ops . convert_extent3d ( value , context . get ( '<STR_LIT>' ) ) <EOL> class MakeLine ( GeoAggregate ) : <EOL> name = '<STR_LIT>' <EOL> class Union ( GeoAggregate ) : <EOL> name = '<STR_LIT>' </s>
