我无法使用evolve
将我的模型从ForeignKey更改为ManyToManyField我的模特:
class Orden(models.Model):
perfil = models.ForeignKey(Perfil, blank=True, null=True)
我尝试更改为
perfil = models.ManyToManyField(Perfil, blank=True, null=True)
如果我创建一个新数据库,一切正常。
这是输出:
python manage.py evolve --hint
Traceback (most recent call last):
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 399, in execute_from_command_line
utility.execute()
File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 392, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 242, in run_from_argv
self.execute(*args, **options.__dict__)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 285, in execute
output = self.handle(*args, **options)
File "/usr/local/lib/python2.7/dist-packages/django_evolution/management/commands/evolve.py", line 60, in handle
self.evolve(*app_labels, **options)
File "/usr/local/lib/python2.7/dist-packages/django_evolution/management/commands/evolve.py", line 119, in evolve
hinted_evolution = diff.evolution()
File "/usr/local/lib/python2.7/dist-packages/django_evolution/diff.py", line 246, in evolution
ATTRIBUTE_DEFAULTS[prop])
KeyError: 'field_type'