(self, compiler, connection, **extra_context)
| 1335 | arity = None |
| 1336 | |
| 1337 | def as_sql(self, compiler, connection, **extra_context): |
| 1338 | copy = self.copy() |
| 1339 | # Most database backends do not support compiling multiple |
| 1340 | # arguments on the Max aggregate, and that isn't what is being |
| 1341 | # tested here anyway. To avoid errors, the extra argument is |
| 1342 | # just dropped. |
| 1343 | copy.set_source_expressions( |
| 1344 | copy.get_source_expressions()[0:1] + [None, None] |
| 1345 | ) |
| 1346 | |
| 1347 | return super(MultiArgAgg, copy).as_sql(compiler, connection) |
| 1348 | |
| 1349 | with self.assertRaisesMessage(TypeError, "Complex aggregates require an alias"): |
| 1350 | Book.objects.aggregate(MultiArgAgg("pages", "price")) |
nothing calls this directly
no test coverage detected