Django problem during migration - lazy link

I added this model to my application

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="") 

Now the makemigrations and migrate commands give me the following error:

  >>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' 

I'm not sure what that means. But I remember that at some point mainApp.modelpatients existed and then it was changed to mainApp.modelpatient which still exists. How to solve this problem and why is this happening? Any help would be appreciated.

+5
source share
1 answer

Try using RenamModel and RenameField . See the answer here: fooobar.com/questions/31643 / ...

+2
source

Source: https://habr.com/ru/post/1265019/


All Articles