MCPcopy
hub / github.com/django/django / _get_expr_references

Method _get_expr_references

django/db/models/base.py:2488–2501  ·  view source on GitHub ↗
(cls, expr)

Source from the content-addressed store, hash-verified

2486
2487 @classmethod
2488 def _get_expr_references(cls, expr):
2489 if isinstance(expr, Q):
2490 for child in expr.children:
2491 if isinstance(child, tuple):
2492 lookup, value = child
2493 yield tuple(lookup.split(LOOKUP_SEP))
2494 yield from cls._get_expr_references(value)
2495 else:
2496 yield from cls._get_expr_references(child)
2497 elif isinstance(expr, F):
2498 yield tuple(expr.name.split(LOOKUP_SEP))
2499 elif hasattr(expr, "get_source_expressions"):
2500 for src_expr in expr.get_source_expressions():
2501 yield from cls._get_expr_references(src_expr)
2502
2503 @classmethod
2504 def _check_constraints(cls, databases):

Callers 9

checkMethod · 0.80
references_fieldMethod · 0.80
checkMethod · 0.80
checkMethod · 0.80
checkMethod · 0.80

Calls 2

splitMethod · 0.45

Tested by

no test coverage detected