summaryrefslogtreecommitdiff
path: root/docs/topics
diff options
context:
space:
mode:
authorFlorian Hahn <flo@fhahn.com>2013-02-21 23:02:18 +0100
committerTim Graham <timograham@gmail.com>2013-10-22 10:29:57 -0400
commit5240b83462ba4887b67da8d493dfdc23fec5df97 (patch)
tree7bae13c499bc84b5f4bcf79c592aa2a9b8008033 /docs/topics
parent1597503a017a9ced422a81d314cb4097d53c3dfd (diff)
Fixed #17027 -- Added support for the power operator in F expressions.
Thanks dan at dlo.me for the initial patch. - Added __pow__ and __rpow__ to ExpressionNode - Added oracle and mysql specific power expressions - Added used-defined power function for sqlite
Diffstat (limited to 'docs/topics')
-rw-r--r--docs/topics/db/queries.txt6
1 files changed, 5 insertions, 1 deletions
diff --git a/docs/topics/db/queries.txt b/docs/topics/db/queries.txt
index 1180022d6e..7b38dbaea3 100644
--- a/docs/topics/db/queries.txt
+++ b/docs/topics/db/queries.txt
@@ -610,12 +610,16 @@ and use that ``F()`` object in the query::
>>> Entry.objects.filter(n_comments__gt=F('n_pingbacks'))
Django supports the use of addition, subtraction, multiplication,
-division and modulo arithmetic with ``F()`` objects, both with constants
+division, modulo, and power arithmetic with ``F()`` objects, both with constants
and with other ``F()`` objects. To find all the blog entries with more than
*twice* as many comments as pingbacks, we modify the query::
>>> Entry.objects.filter(n_comments__gt=F('n_pingbacks') * 2)
+.. versionadded:: 1.7
+
+ The power operator ``**`` was added.
+
To find all the entries where the rating of the entry is less than the
sum of the pingback count and comment count, we would issue the
query::