mirror of
https://github.com/django/django.git
synced 2025-10-24 14:16:09 +00:00
Fixed #32231 -- Allowed passing None params to QuerySet.raw().
This commit is contained in:
committed by
Mariusz Felisiak
parent
aa3d360631
commit
415f50298f
@@ -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
|
||||
----------------------------------------
|
||||
|
||||
|
||||
@@ -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
|
||||
------------------------------------
|
||||
|
||||
|
||||
Reference in New Issue
Block a user