MCPcopy
hub / github.com/django/django / _field_db_check

Method _field_db_check

django/db/backends/base/schema.py:942–951  ·  view source on GitHub ↗
(self, field, field_db_params)

Source from the content-addressed store, hash-verified

940 )
941
942 def _field_db_check(self, field, field_db_params):
943 # Always check constraints with the same mocked column name to avoid
944 # recreating constraints when the column is renamed.
945 check_constraints = self.connection.data_type_check_constraints
946 data = field.db_type_parameters(self.connection)
947 data["column"] = "__column_name__"
948 try:
949 return check_constraints[field.get_internal_type()] % data
950 except KeyError:
951 return None
952
953 def _alter_field(
954 self,

Callers 1

_alter_fieldMethod · 0.95

Calls 2

db_type_parametersMethod · 0.45
get_internal_typeMethod · 0.45

Tested by

no test coverage detected