diff options
author | Tim Graham <timograham@gmail.com> | 2016-03-03 19:34:31 -0500 |
---|---|---|
committer | Tim Graham <timograham@gmail.com> | 2016-03-03 19:38:06 -0500 |
commit | 8b891cf3862658b6b297063b3efeb81f1985cda3 (patch) | |
tree | 77af1a20cad54b9ee23c0f03f6b4c9572889a8dc | |
parent | e4be3c80a1dc948adaecaab0d32e7537c8f7e011 (diff) | |
download | django-8b891cf3862658b6b297063b3efeb81f1985cda3.tar.gz |
[1.8.x] Fixed #26321 -- Added missing "for_save" parameter in expressions example.
Thanks tomaszn for the patch.
Backport of de8a11ba18d5902c668d4db47c38c9c6bdf9c1da from master
-rw-r--r-- | docs/ref/models/expressions.txt | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/docs/ref/models/expressions.txt b/docs/ref/models/expressions.txt index 2f780e4205..67c2f39260 100644 --- a/docs/ref/models/expressions.txt +++ b/docs/ref/models/expressions.txt @@ -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:: |