diff options
| author | Josh Smeaton <josh.smeaton@gmail.com> | 2015-03-17 11:38:55 +1100 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2015-03-17 08:40:45 -0400 |
| commit | a0cebe82b532672d9e293c058f76711d2fcc6863 (patch) | |
| tree | ae78336160dcdea9a796dd6880d6b148e15b1f80 /docs/ref | |
| parent | 34e09e532da41d56d3ba68babd05c4fd848abaa2 (diff) | |
[1.8.x] Refs #24485 -- Renamed some expression types
Backport of 88d798d71a20662bdf5335f0586fb9eb6e660c57 from master
Diffstat (limited to 'docs/ref')
| -rw-r--r-- | docs/ref/models/expressions.txt | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/docs/ref/models/expressions.txt b/docs/ref/models/expressions.txt index ef319d5d10..7826c9cc50 100644 --- a/docs/ref/models/expressions.txt +++ b/docs/ref/models/expressions.txt @@ -284,9 +284,9 @@ should define the desired ``output_field``. For example, adding an arithmetic between different types, it's necessary to surround the expression in another expression:: - from django.db.models import DateTimeField, ExpressionNode, F + from django.db.models import DateTimeField, Expression, F - Race.objects.annotate(finish=ExpressionNode( + Race.objects.annotate(finish=Expression( F('start') + F('duration'), output_field=DateTimeField())) .. versionchanged:: 1.8 @@ -369,13 +369,13 @@ Expression API Query expressions implement the :ref:`query expression API <query-expression>`, but also expose a number of extra methods and attributes listed below. All -query expressions must inherit from ``ExpressionNode()`` or a relevant +query expressions must inherit from ``Expression()`` or a relevant subclass. When a query expression wraps another expression, it is responsible for calling the appropriate methods on the wrapped expression. -.. class:: ExpressionNode +.. class:: Expression .. attribute:: contains_aggregate @@ -489,9 +489,9 @@ We'll start by defining the template to be used for SQL generation and an ``__init__()`` method to set some attributes:: import copy - from django.db.models import ExpressionNode + from django.db.models import Expression - class Coalesce(ExpressionNode): + class Coalesce(Expression): template = 'COALESCE( %(expressions)s )' def __init__(self, expressions, output_field, **extra): |
