File "E:\PhytonProgects\natarelke\users\models.py", line 6, in <module>
from catalog.models import Dish
File "E:\PhytonProgects\natarelke\catalog\models.py", line 5, in <module>
from users.models import RegModel
ImportError: cannot import name RegModel
嘗試做makemigrations
但一個錯誤,如果我將刪除from users.models import RegModel
我會給另一個錯誤Django的makemigrations導入錯誤
File "E:\PhytonProgects\natarelke\catalog\models.py", line 115, in Review
user = models.ForeignKey(RegModel, verbose_name=u'123',
NameError: name 'RegModel' is not defined
我怎樣才能解決這個問題?把它添加後dish
場表
class UserFavs(models.Model):
user = models.ForeignKey(RegModel, verbose_name=u'Пользователь',
related_name="user", null=True)
dish = models.ForeignKey(Dish, verbose_name=u'Блюдо',
related_name="dish")
您可以顯示RegModel類。 – eyllanesc
嗯...我如何解決它? –