How to use 'aggregation in python' in Python

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.

All examples are scanned by Snyk Code

By copying the Snyk Code Snippets you agree to
this disclaimer
299def 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)
Important

Use secure code every time

Secure your code as it's written. Use Snyk Code to scan source code in minutes – no build needed – and fix issues immediately. Enable Snyk Code


Related snippets