web/lib/django/db/models/aggregates.py
changeset 29 cc9b7e14412b
parent 0 0d40e90630ef
equal deleted inserted replaced
28:b758351d191f 29:cc9b7e14412b
    41          * is_summary is a boolean that is set True if the aggregate is a
    41          * is_summary is a boolean that is set True if the aggregate is a
    42            summary value rather than an annotation.
    42            summary value rather than an annotation.
    43         """
    43         """
    44         klass = getattr(query.aggregates_module, self.name)
    44         klass = getattr(query.aggregates_module, self.name)
    45         aggregate = klass(col, source=source, is_summary=is_summary, **self.extra)
    45         aggregate = klass(col, source=source, is_summary=is_summary, **self.extra)
    46         # Validate that the backend has a fully supported, correct
       
    47         # implementation of this aggregate
       
    48         query.connection.ops.check_aggregate_support(aggregate)
       
    49         query.aggregates[alias] = aggregate
    46         query.aggregates[alias] = aggregate
    50 
    47 
    51 class Avg(Aggregate):
    48 class Avg(Aggregate):
    52     name = 'Avg'
    49     name = 'Avg'
    53 
    50