[英]I get this Error AttributeError at /listings/5689-resot-relly-market, 'Profile' object has no attribute 'favourite' please any help would be apprciate
I'm working a add to favourite function in django and i keep getting this error when i hit the save button.我正在 django 中添加最喜欢的 function,当我点击保存按钮时,我一直收到此错误。 everything looks fine from here that why i can't really tell where the error is coming from从这里看起来一切都很好,为什么我不能真正告诉错误来自哪里
Models.py模型.py
class Profile(models.Model):
user = models.OneToOneField(User, related_name='profile', on_delete=models.CASCADE)
...
favorite = models.ManyToManyField(Accomodation, related_name='profile')
I mis-spelt favourite so i changed this line我拼错了最喜欢的所以我改变了这一行
favorite = models.ManyToManyField(Accomodation, related_name='profile')
to至
favourite = models.ManyToManyField(Accomodation, related_name='profile')
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.