MCPcopy
hub / github.com/django/django / reduce

Method reduce

django/db/migrations/operations/models.py:1184–1197  ·  view source on GitHub ↗
(self, operation, app_label)

Source from the content-addressed store, hash-verified

1182 return "%s_%s" % (self.model_name_lower, self.constraint.name.lower())
1183
1184 def reduce(self, operation, app_label):
1185 if (
1186 isinstance(operation, RemoveConstraint)
1187 and self.model_name_lower == operation.model_name_lower
1188 and self.constraint.name == operation.name
1189 ):
1190 return []
1191 if (
1192 isinstance(operation, AlterConstraint)
1193 and self.model_name_lower == operation.model_name_lower
1194 and self.constraint.name == operation.name
1195 ):
1196 return [replace(self, constraint=operation.constraint)]
1197 return super().reduce(operation, app_label)
1198
1199
1200class RemoveConstraint(IndexOperation):

Callers

nothing calls this directly

Calls 2

replaceFunction · 0.90
reduceMethod · 0.45

Tested by

no test coverage detected