MCPcopy
hub / github.com/django/django / __init__

Method __init__

django/contrib/postgres/search.py:236–258  ·  view source on GitHub ↗
(
        self,
        value,
        output_field=None,
        *,
        config=None,
        invert=False,
        search_type="plain",
    )

Source from the content-addressed store, hash-verified

234 }
235
236 def __init__(
237 self,
238 value,
239 output_field=None,
240 *,
241 config=None,
242 invert=False,
243 search_type="plain",
244 ):
245 if isinstance(value, LexemeCombinable):
246 search_type = "raw"
247
248 self.function = self.SEARCH_TYPES.get(search_type)
249 if self.function is None:
250 raise ValueError("Unknown search_type argument '%s'." % search_type)
251 if not hasattr(value, "resolve_expression"):
252 value = Value(value)
253 expressions = (value,)
254 self.config = SearchConfig.from_parameter(config)
255 if self.config is not None:
256 expressions = [self.config, *expressions]
257 self.invert = invert
258 super().__init__(*expressions, output_field=output_field)
259
260 def as_sql(self, compiler, connection, function=None, template=None):
261 sql, params = super().as_sql(compiler, connection, function, template)

Callers

nothing calls this directly

Calls 4

ValueClass · 0.90
from_parameterMethod · 0.80
getMethod · 0.45
__init__Method · 0.45

Tested by

no test coverage detected