MCPcopy
hub / github.com/django/django / _get_condition_sql

Method _get_condition_sql

django/db/models/constraints.py:442–449  ·  view source on GitHub ↗
(self, model, schema_editor)

Source from the content-addressed store, hash-verified

440 return errors
441
442 def _get_condition_sql(self, model, schema_editor):
443 if self.condition is None:
444 return None
445 query = Query(model=model, alias_cols=False)
446 where = query.build_where(self.condition)
447 compiler = query.get_compiler(connection=schema_editor.connection)
448 sql, params = where.as_sql(compiler, schema_editor.connection)
449 return sql % tuple(schema_editor.quote_value(p) for p in params)
450
451 def _get_index_expressions(self, model, schema_editor):
452 if not self.expressions:

Callers 3

constraint_sqlMethod · 0.95
create_sqlMethod · 0.95
remove_sqlMethod · 0.95

Calls 5

build_whereMethod · 0.95
get_compilerMethod · 0.95
QueryClass · 0.90
as_sqlMethod · 0.45
quote_valueMethod · 0.45

Tested by

no test coverage detected