Ticket #26321: fixed_postgres_custom_agg_example.patch

File fixed_postgres_custom_agg_example.patch, 1.5 KB (added by Tomasz Nowak, 9 years ago)
  • docs/ref/models/expressions.txt

    diff --git a/docs/ref/models/expressions.txt b/docs/ref/models/expressions.txt
    index f48dcbb..c5a433c 100644
    a b calling the appropriate methods on the wrapped expression.  
    448448        Tells Django that this expression contains an aggregate and that a
    449449        ``GROUP BY`` clause needs to be added to the query.
    450450
    451     .. method:: resolve_expression(query=None, allow_joins=True, reuse=None, summarize=False)
     451    .. method:: resolve_expression(query=None, allow_joins=True, reuse=None, summarize=False, for_save=False)
    452452
    453453        Provides the chance to do any pre-processing or validation of
    454454        the expression before it's added to the query. ``resolve_expression()``
    Now we implement the pre-processing and validation. Since we do not have  
    579579any of our own validation at this point, we just delegate to the nested
    580580expressions::
    581581
    582     def resolve_expression(self, query=None, allow_joins=True, reuse=None, summarize=False):
     582    def resolve_expression(self, query=None, allow_joins=True, reuse=None, summarize=False, for_save=False):
    583583        c = self.copy()
    584584        c.is_summary = summarize
    585585        for pos, expression in enumerate(self.expressions):
    586             c.expressions[pos] = expression.resolve_expression(query, allow_joins, reuse, summarize)
     586            c.expressions[pos] = expression.resolve_expression(query, allow_joins, reuse, summarize, for_save)
    587587        return c
    588588
    589589Next, we write the method responsible for generating the SQL::
Back to Top