id,summary,reporter,owner,description,type,status,component,version,severity,resolution,keywords,cc,stage,has_patch,needs_docs,needs_tests,needs_better_patch,easy,ui_ux 28658,Move DISTINCT handling to the Aggregate base class.,Simon Charette,Simon Charette,"Django ships with a few `Aggregate` subclasses that expose a `distinct` kwarg in order to inject a `DISTINCT` clause on compilation. Since `DISTINCT` is repeatedly used by subclasses and likely to be useful for custom `Aggregate` subclasses (PostgreSQL supports `DISTINCT` on all aggregate functions, SQLite on all aggregates with a single argument, ...) I suggest we handle it in the `Aggregate` base class. We should be able to rely on `DatebaseOperations.check_expression_support` to prevent `distinct=True` from being passed to aggregates not supporting it on a backend basis.",Cleanup/optimization,closed,"Database layer (models, ORM)",dev,Normal,fixed,,,Accepted,1,0,0,0,0,0