Skip to content

Commit b00ee54

Browse files
sir-sigurdtimgraham
authored andcommitted
Simplified handling of expressions in StatAggregate.
1 parent 001cf53 commit b00ee54

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

django/contrib/postgres/aggregates/statistics.py

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,7 @@ class StatAggregate(Aggregate):
1111
def __init__(self, y, x, output_field=FloatField()):
1212
if not x or not y:
1313
raise ValueError('Both y and x must be provided.')
14-
super().__init__(y=y, x=x, output_field=output_field)
15-
self.x = x
16-
self.y = y
17-
self.source_expressions = self._parse_expressions(self.y, self.x)
18-
19-
def get_source_expressions(self):
20-
return self.y, self.x
21-
22-
def set_source_expressions(self, exprs):
23-
self.y, self.x = exprs
14+
super().__init__(y, x, output_field=output_field)
2415

2516
def resolve_expression(self, query=None, allow_joins=True, reuse=None, summarize=False, for_save=False):
2617
return super().resolve_expression(query, allow_joins, reuse, summarize)

0 commit comments

Comments
 (0)