与现有模型的django-mptt错误

时间:2012-09-26 10:53:46

标签: django django-admin django-mptt

当我尝试使用常规模型的MPTTMODEL时,我已经有模型主题并且有数据

class Topic(MPTTModel):
    parent = TreeForeignKey('self', null=True, blank=True, related_name='children')
    ....

所以我运行以下命令来迁移主题表中的父列

./manage.py evolve --hint --execute

但我收到此错误

Error: Cannot use hinted evolution: AddField or ChangeField mutation for 'Topic.rght' in 'core' requires user-specified initial value.

它适用于新模型,但现有的模型有数据会引发此错误

0 个答案:

没有答案
相关问题