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

Method as_sql

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

Source from the content-addressed store, hash-verified

482 super().__init__(value, output_field=output_field)
483
484 def as_sql(self, compiler, connection):
485 param = quote_lexeme(self.value)
486 label = ""
487 if self.prefix:
488 label += "*"
489 if self.weight:
490 label += self.weight
491
492 if label:
493 param = f"{param}:{label}"
494 if self.invert:
495 param = f"!{param}"
496
497 return "%s", (param,)
498
499 def __invert__(self):
500 cloned = self.copy()

Callers 4

as_sqlMethod · 0.45
as_sqlMethod · 0.45
as_sqlMethod · 0.45
_get_condition_sqlMethod · 0.45

Calls 1

quote_lexemeFunction · 0.85

Tested by

no test coverage detected