summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
Diffstat (limited to 'docs')
-rw-r--r--docs/ref/models/queries.txt4
-rw-r--r--docs/releases/1.7.txt3
-rw-r--r--docs/topics/db/queries.txt6
3 files changed, 12 insertions, 1 deletions
diff --git a/docs/ref/models/queries.txt b/docs/ref/models/queries.txt
index ebc5142b30..bf7480ef69 100644
--- a/docs/ref/models/queries.txt
+++ b/docs/ref/models/queries.txt
@@ -112,6 +112,10 @@ As well as addition, Django supports subtraction, multiplication, division,
and modulo arithmetic with ``F()`` objects, using Python constants,
variables, and even other ``F()`` objects.
+.. versionadded:: 1.7
+
+ The power operator ``**`` is also supported.
+
``Q()`` objects
===============
diff --git a/docs/releases/1.7.txt b/docs/releases/1.7.txt
index 699566f1d3..542efc46b9 100644
--- a/docs/releases/1.7.txt
+++ b/docs/releases/1.7.txt
@@ -346,6 +346,9 @@ Models
:attr:`~django.db.models.ForeignKey.related_name` to
`'+'` or ending it with `'+'`.
+* :class:`F expressions <django.db.models.F>` support the power operator
+ (``**``).
+
Signals
^^^^^^^
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::