MCPcopy
hub / github.com/django/django / database_backwards

Method database_backwards

django/db/migrations/operations/fields.py:180–184  ·  view source on GitHub ↗
(self, app_label, schema_editor, from_state, to_state)

Source from the content-addressed store, hash-verified

178 )
179
180 def database_backwards(self, app_label, schema_editor, from_state, to_state):
181 to_model = to_state.apps.get_model(app_label, self.model_name)
182 if self.allow_migrate_model(schema_editor.connection.alias, to_model):
183 from_model = from_state.apps.get_model(app_label, self.model_name)
184 schema_editor.add_field(from_model, to_model._meta.get_field(self.name))
185
186 def describe(self):
187 return "Remove field %s from %s" % (self.name, self.model_name)

Callers 2

test_remove_fieldMethod · 0.95
test_remove_fkMethod · 0.95

Calls 4

get_modelMethod · 0.45
allow_migrate_modelMethod · 0.45
add_fieldMethod · 0.45
get_fieldMethod · 0.45

Tested by 2

test_remove_fieldMethod · 0.76
test_remove_fkMethod · 0.76