summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorMariusz Felisiak <felisiak.mariusz@gmail.com>2021-11-23 07:04:04 +0100
committerGitHub <noreply@github.com>2021-11-23 07:04:04 +0100
commita17becf4c7f4e4057e8c94990e4b4999be0aea95 (patch)
tree27170410b9f068e880c06c77c2ea69326713b888 /docs
parent8b020f2e64f1cbf2b06205a389a13af6623f90ce (diff)
Corrected signatures of QuerySet's methods.
Diffstat (limited to 'docs')
-rw-r--r--docs/ref/models/querysets.txt14
1 files changed, 7 insertions, 7 deletions
diff --git a/docs/ref/models/querysets.txt b/docs/ref/models/querysets.txt
index 01929bc256..b2bf5baf90 100644
--- a/docs/ref/models/querysets.txt
+++ b/docs/ref/models/querysets.txt
@@ -179,7 +179,7 @@ executed.
``filter()``
~~~~~~~~~~~~
-.. method:: filter(**kwargs)
+.. method:: filter(*args, **kwargs)
Returns a new ``QuerySet`` containing objects that match the given lookup
parameters.
@@ -189,12 +189,12 @@ The lookup parameters (``**kwargs``) should be in the format described in
underlying SQL statement.
If you need to execute more complex queries (for example, queries with ``OR`` statements),
-you can use :class:`Q objects <django.db.models.Q>`.
+you can use :class:`Q objects <django.db.models.Q>` (``*args``).
``exclude()``
~~~~~~~~~~~~~
-.. method:: exclude(**kwargs)
+.. method:: exclude(*args, **kwargs)
Returns a new ``QuerySet`` containing objects that do *not* match the given
lookup parameters.
@@ -231,7 +231,7 @@ In SQL terms, that evaluates to:
Note the second example is more restrictive.
If you need to execute more complex queries (for example, queries with ``OR`` statements),
-you can use :class:`Q objects <django.db.models.Q>`.
+you can use :class:`Q objects <django.db.models.Q>` (``*args``).
``annotate()``
~~~~~~~~~~~~~~
@@ -1843,7 +1843,7 @@ raised if ``select_for_update()`` is used in autocommit mode.
``raw()``
~~~~~~~~~
-.. method:: raw(raw_query, params=(), translations=None)
+.. method:: raw(raw_query, params=(), translations=None, using=None)
Takes a raw SQL query, executes it, and returns a
``django.db.models.query.RawQuerySet`` instance. This ``RawQuerySet`` instance
@@ -1910,7 +1910,7 @@ they query the database each time they're called.
``get()``
~~~~~~~~~
-.. method:: get(**kwargs)
+.. method:: get(*args, **kwargs)
Returns the object matching the given lookup parameters, which should be in
the format described in `Field lookups`_. You should use lookups that are
@@ -1918,7 +1918,7 @@ guaranteed unique, such as the primary key or fields in a unique constraint.
For example::
Entry.objects.get(id=1)
- Entry.objects.get(blog=blog, entry_number=1)
+ Entry.objects.get(Q(blog=blog) & Q(entry_number=1))
If you expect a queryset to already return one row, you can use ``get()``
without any arguments to return the object for that row::