Fixed #26321 -- Added missing "for_save" parameter in expressions example.

Thanks tomaszn for the patch.
This commit is contained in:
Tim Graham 2016-03-03 19:34:31 -05:00
parent b886f166b3
commit de8a11ba18
1 changed files with 3 additions and 3 deletions

View File

@ -448,7 +448,7 @@ calling the appropriate methods on the wrapped expression.
Tells Django that this expression contains an aggregate and that a
``GROUP BY`` clause needs to be added to the query.
.. method:: resolve_expression(query=None, allow_joins=True, reuse=None, summarize=False)
.. method:: resolve_expression(query=None, allow_joins=True, reuse=None, summarize=False, for_save=False)
Provides the chance to do any pre-processing or validation of
the expression before it's added to the query. ``resolve_expression()``
@ -579,11 +579,11 @@ Now we implement the pre-processing and validation. Since we do not have
any of our own validation at this point, we just delegate to the nested
expressions::
def resolve_expression(self, query=None, allow_joins=True, reuse=None, summarize=False):
def resolve_expression(self, query=None, allow_joins=True, reuse=None, summarize=False, for_save=False):
c = self.copy()
c.is_summary = summarize
for pos, expression in enumerate(self.expressions):
c.expressions[pos] = expression.resolve_expression(query, allow_joins, reuse, summarize)
c.expressions[pos] = expression.resolve_expression(query, allow_joins, reuse, summarize, for_save)
return c
Next, we write the method responsible for generating the SQL::