diff options
| author | Sergey Fedoseev <fedoseev.sergey@gmail.com> | 2017-03-23 22:05:59 +0500 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2017-03-23 13:05:59 -0400 |
| commit | b00ee5471df5741ff3c0f55321eba676c978618a (patch) | |
| tree | f5b38a53dfe83195847ecb42d156967a2bf975b3 | |
| parent | 001cf53280f7e2b72199237f37c340d2639fe143 (diff) | |
Simplified handling of expressions in StatAggregate.
| -rw-r--r-- | django/contrib/postgres/aggregates/statistics.py | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/django/contrib/postgres/aggregates/statistics.py b/django/contrib/postgres/aggregates/statistics.py index 2af5b6b359..ef6d172e57 100644 --- a/django/contrib/postgres/aggregates/statistics.py +++ b/django/contrib/postgres/aggregates/statistics.py @@ -11,16 +11,7 @@ class StatAggregate(Aggregate): def __init__(self, y, x, output_field=FloatField()): if not x or not y: raise ValueError('Both y and x must be provided.') - super().__init__(y=y, x=x, output_field=output_field) - self.x = x - self.y = y - self.source_expressions = self._parse_expressions(self.y, self.x) - - def get_source_expressions(self): - return self.y, self.x - - def set_source_expressions(self, exprs): - self.y, self.x = exprs + super().__init__(y, x, output_field=output_field) def resolve_expression(self, query=None, allow_joins=True, reuse=None, summarize=False, for_save=False): return super().resolve_expression(query, allow_joins, reuse, summarize) |
