MCPcopy
hub / github.com/django/django / as_sql

Method as_sql

django/contrib/postgres/search.py:508–518  ·  view source on GitHub ↗
(self, compiler, connection)

Source from the content-addressed store, hash-verified

506 _output_field = SearchQueryField()
507
508 def as_sql(self, compiler, connection):
509 value_params = []
510 lsql, params = compiler.compile(self.lhs)
511 value_params.extend(params)
512
513 rsql, params = compiler.compile(self.rhs)
514 value_params.extend(params)
515
516 combined_sql = f"({lsql} {self.connector} {rsql})"
517 combined_value = combined_sql % tuple(value_params)
518 return "%s", (combined_value,)
519
520 def __invert__(self):
521 # Apply De Morgan's theorem.

Callers

nothing calls this directly

Calls 2

extendMethod · 0.80
compileMethod · 0.45

Tested by

no test coverage detected