MCPcopy
hub / github.com/django/django / _resolve_output_field

Method _resolve_output_field

django/db/models/expressions.py:747–762  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

745 self.lhs, self.rhs = exprs
746
747 def _resolve_output_field(self):
748 # We avoid using super() here for reasons given in
749 # Expression._resolve_output_field()
750 combined_type = _resolve_combined_type(
751 self.connector,
752 type(self.lhs._output_field_or_none),
753 type(self.rhs._output_field_or_none),
754 )
755 if combined_type is None:
756 raise FieldError(
757 f"Cannot infer type of {self.connector!r} expression involving these "
758 f"types: {self.lhs.output_field.__class__.__name__}, "
759 f"{self.rhs.output_field.__class__.__name__}. You must set "
760 f"output_field."
761 )
762 return combined_type()
763
764 def as_sql(self, compiler, connection):
765 expressions = []

Callers

nothing calls this directly

Calls 2

FieldErrorClass · 0.90
_resolve_combined_typeFunction · 0.85

Tested by

no test coverage detected