diff options
Diffstat (limited to 'docs')
| -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): |
