summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorAlexander Lyabah <a.lyabah@checkio.org>2020-11-28 18:08:27 +0200
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2021-01-05 10:37:11 +0100
commit415f50298f97fb17f841a9df38d995ccf347dfcc (patch)
tree3907c7f089deaae35a4d1f96e1208ba2e79e8aa1 /docs
parentaa3d36063174cc1e16a1e5150b6b47609dd1e79a (diff)
Fixed #32231 -- Allowed passing None params to QuerySet.raw().
Diffstat (limited to 'docs')
-rw-r--r--docs/ref/models/querysets.txt7
-rw-r--r--docs/topics/db/sql.txt7
2 files changed, 12 insertions, 2 deletions
diff --git a/docs/ref/models/querysets.txt b/docs/ref/models/querysets.txt
index 70a6989306..2c8c2e38fd 100644
--- a/docs/ref/models/querysets.txt
+++ b/docs/ref/models/querysets.txt
@@ -1843,7 +1843,7 @@ raised if ``select_for_update()`` is used in autocommit mode.
``raw()``
~~~~~~~~~
-.. method:: raw(raw_query, params=None, translations=None)
+.. method:: raw(raw_query, params=(), translations=None)
Takes a raw SQL query, executes it, and returns a
``django.db.models.query.RawQuerySet`` instance. This ``RawQuerySet`` instance
@@ -1858,6 +1858,11 @@ See the :doc:`/topics/db/sql` for more information.
filtering. As such, it should generally be called from the ``Manager`` or
from a fresh ``QuerySet`` instance.
+.. versionchanged:: 3.2
+
+ The default value of the ``params`` argument was changed from ``None`` to
+ an empty tuple.
+
Operators that return new ``QuerySet``\s
----------------------------------------
diff --git a/docs/topics/db/sql.txt b/docs/topics/db/sql.txt
index c7224c78b0..fe7b0a4bd8 100644
--- a/docs/topics/db/sql.txt
+++ b/docs/topics/db/sql.txt
@@ -43,7 +43,7 @@ Performing raw queries
The ``raw()`` manager method can be used to perform raw SQL queries that
return model instances:
-.. method:: Manager.raw(raw_query, params=None, translations=None)
+.. method:: Manager.raw(raw_query, params=(), translations=None)
This method takes a raw SQL query, executes it, and returns a
``django.db.models.query.RawQuerySet`` instance. This ``RawQuerySet`` instance
@@ -99,6 +99,11 @@ make it very powerful.
both rows will match. To prevent this, perform the correct typecasting
before using the value in a query.
+.. versionchanged:: 3.2
+
+ The default value of the ``params`` argument was changed from ``None`` to
+ an empty tuple.
+
Mapping query fields to model fields
------------------------------------