Skip to content

Commit

Permalink
[1.9.x] Refs #14030 -- Updated docs per "Improved expression support …
Browse files Browse the repository at this point in the history
…for python values."

Complements e2d6e14.

Backport of db613f4 from master
  • Loading branch information
sir-sigurd authored and timgraham committed Jun 15, 2016
1 parent ab7a0b5 commit 99e51bf
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions docs/ref/models/conditional-expressions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ Keep in mind that each of these values can be an expression.
:class:`~django.db.models.Model` has a field named ``then``. This can be
resolved in two ways::

>>> from django.db.models import Value
>>> When(then__exact=0, then=1)
>>> When(Q(then=0), then=1)

Expand Down Expand Up @@ -118,8 +117,8 @@ A simple example::
``Case()`` accepts any number of ``When()`` objects as individual arguments.
Other options are provided using keyword arguments. If none of the conditions
evaluate to ``TRUE``, then the expression given with the ``default`` keyword
argument is returned. If no ``default`` argument is provided, ``Value(None)``
is used.
argument is returned. If a ``default`` argument isn't provided, ``None`` is
used.

If we wanted to change our previous query to get the discount based on how long
the ``Client`` has been with us, we could do so using lookups::
Expand Down

0 comments on commit 99e51bf

Please sign in to comment.