【发布时间】:2017-07-24 11:29:16
【问题描述】:
我目前将此模型添加到我的应用中
from mainApp.models import modelPatient
class modelBodyParts(models.Model):
part_name = models.CharField(max_length=1000, unique=False , default="")
modelPatient = models.ForeignKey(modelPatient)
result = models.CharField(max_length=3000, unique=False , default="")
现在 makemigrations 和 migrate 命令给我以下错误
>>python manage.py makemigrations
>>python ./manage.py migrate
ValueError: The field interviewApp.modelInterviewAnswers.patients was declared with a lazy reference to 'mainApp.modelpatients', but app 'mainApp' doesn't provide model 'modelpatients'
我不确定这意味着什么。但我确实记得在某一时刻mainApp.modelpatients 存在,然后它被更改为mainApp.modelpatient
仍然存在。我该如何解决这个问题,为什么会出现?任何帮助将不胜感激。
【问题讨论】:
-
问题解决了吗?
标签: django django-models