MCPcopy
hub / github.com/django/django / process_rhs

Method process_rhs

django/db/models/lookups.py:595–608  ·  view source on GitHub ↗
(self, qn, connection)

Source from the content-addressed store, hash-verified

593 return super().get_rhs_op(connection, rhs)
594
595 def process_rhs(self, qn, connection):
596 rhs, params = super().process_rhs(qn, connection)
597 # Assume the lookup is startswith. For simple lookups involving a
598 # Python value like "thevalue", the (SQL, params) is something like:
599 # ("col LIKE %s", ['thevalue%'])
600 if self.is_simple_lookup:
601 # Prepare the lookup parameter, a Python value, for use in a LIKE
602 # clause, usually by adding % signs to the beginning and/or end of
603 # the value.
604 param = connection.ops.prep_for_like_query(params[0])
605 if connection.features.pattern_lookup_needs_param_pattern:
606 param = self.param_pattern % param
607 params = (param, *params[1:])
608 return rhs, params
609
610 @property
611 def is_simple_lookup(self):

Callers

nothing calls this directly

Calls 2

prep_for_like_queryMethod · 0.80
process_rhsMethod · 0.45

Tested by

no test coverage detected