MCPcopy
hub / github.com/django/django / select_format

Method select_format

django/db/models/sql/where.py:302–308  ·  view source on GitHub ↗
(self, compiler, sql, params)

Source from the content-addressed store, hash-verified

300 return self.output_field
301
302 def select_format(self, compiler, sql, params):
303 # Wrap filters with a CASE WHEN expression if a database backend
304 # (e.g. Oracle) doesn't support boolean expression in SELECT or GROUP
305 # BY list.
306 if not compiler.connection.features.supports_boolean_expr_in_select_clause:
307 sql = f"CASE WHEN {sql} THEN 1 ELSE 0 END"
308 return sql, params
309
310 def get_db_converters(self, connection):
311 return self.output_field.get_db_converters(connection)

Callers 3

get_group_byMethod · 0.45
get_selectMethod · 0.45
as_sqlMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected