MCPcopy
hub / github.com/django/django / check_filterable

Method check_filterable

django/db/models/sql/query.py:1401–1412  ·  view source on GitHub ↗

Raise an error if expression cannot be used in a WHERE clause.

(self, expression)

Source from the content-addressed store, hash-verified

1399 self.check_query_object_type(v, opts, field)
1400
1401 def check_filterable(self, expression):
1402 """Raise an error if expression cannot be used in a WHERE clause."""
1403 if hasattr(expression, "resolve_expression") and not getattr(
1404 expression, "filterable", True
1405 ):
1406 raise NotSupportedError(
1407 expression.__class__.__name__ + " is disallowed in the filter "
1408 "clause."
1409 )
1410 if hasattr(expression, "get_source_expressions"):
1411 for expr in expression.get_source_expressions():
1412 self.check_filterable(expr)
1413
1414 def build_lookup(self, lookups, lhs, rhs):
1415 """

Callers 1

build_filterMethod · 0.95

Calls 2

NotSupportedErrorClass · 0.90

Tested by

no test coverage detected