summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMariusz Felisiak <felisiak.mariusz@gmail.com>2023-10-05 15:26:02 +0200
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2023-10-05 15:26:56 +0200
commit6e7c8cc42e29bc14e7951977977bd510ff9dc3f5 (patch)
treeb46047669948ceeeaa51db0d3271395fd9fb7938
parent458bc9e768ede649e8e540823dd4ec0c6383744b (diff)
[5.0.x] Refs #22936 -- Doc'd Lookup.prepare_rhs.
Backport of 91cb2d0b487acc56d886612a7251b9ba555d71b4 from main
-rw-r--r--docs/ref/models/lookups.txt8
1 files changed, 8 insertions, 0 deletions
diff --git a/docs/ref/models/lookups.txt b/docs/ref/models/lookups.txt
index 3998eb3705..759160affd 100644
--- a/docs/ref/models/lookups.txt
+++ b/docs/ref/models/lookups.txt
@@ -218,6 +218,14 @@ following methods:
The name of this lookup, used to identify it on parsing query
expressions. It cannot contain the string ``"__"``.
+ .. attribute:: prepare_rhs
+
+ Defaults to ``True``. When :attr:`rhs` is a plain value,
+ :attr:`prepare_rhs` determines whether it should be prepared for use as
+ a parameter in a query. In order to do so,
+ ``lhs.output_field.get_prep_value()`` is called if defined, or ``rhs``
+ is wrapped in :class:`Value() <django.db.models.Value>` otherwise.
+
.. method:: process_lhs(compiler, connection, lhs=None)
Returns a tuple ``(lhs_string, lhs_params)``, as returned by