MCPcopy
hub / github.com/django/django / NullIf

Class NullIf

django/db/models/functions/comparison.py:165–173  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

163
164
165class NullIf(Func):
166 function = "NULLIF"
167 arity = 2
168
169 def as_oracle(self, compiler, connection, **extra_context):
170 expression1 = self.get_source_expressions()[0]
171 if isinstance(expression1, Value) and expression1.value is None:
172 raise ValueError("Oracle does not allow Value(None) for expression1.")
173 return super().as_sql(compiler, connection, **extra_context)

Callers 4

test_basicMethod · 0.90
test_null_argumentMethod · 0.90
test_too_few_argsMethod · 0.90
test_null_literalMethod · 0.90

Calls

no outgoing calls

Tested by 4

test_basicMethod · 0.72
test_null_argumentMethod · 0.72
test_too_few_argsMethod · 0.72
test_null_literalMethod · 0.72