1
0
mirror of https://github.com/django/django.git synced 2025-10-29 00:26:07 +00:00

Makemigration command now works

This commit is contained in:
Andrew Godwin
2013-06-19 16:23:52 +01:00
parent ab5cbae9b7
commit f25a385a5e
7 changed files with 87 additions and 7 deletions

View File

@@ -23,6 +23,9 @@ class AddField(Operation):
from_model = from_state.render().get_model(app_label, self.model_name)
schema_editor.remove_field(from_model, from_model._meta.get_field_by_name(self.name)[0])
def describe(self):
return "Add field %s to %s" % (self.name, self.model_name)
class RemoveField(Operation):
"""
@@ -48,3 +51,6 @@ class RemoveField(Operation):
from_model = from_state.render().get_model(app_label, self.model_name)
to_model = to_state.render().get_model(app_label, self.model_name)
schema_editor.add_field(from_model, to_model._meta.get_field_by_name(self.name)[0])
def describe(self):
return "Remove field %s from %s" % (self.name, self.model_name)