Every line of 'aggregation in python' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your Python code is secure.
299 def aggregate(self, *args, **kwargs): 300 """ 301 Returns a dictionary containing the calculations (aggregation) 302 over the current queryset 303 304 If args is present the expression is passed as a kwarg using 305 the Aggregate object's default alias. 306 """ 307 for arg in args: 308 kwargs[arg.default_alias] = arg 309 310 query = self.query.clone() 311 312 for (alias, aggregate_expr) in kwargs.items(): 313 query.add_aggregate(aggregate_expr, self.model, alias, 314 is_summary=True) 315 316 return query.get_aggregation(using=self.db)