![](/img/trans.png)
[英]I get thrown a AttributeError: 'Particle' object has no attribute 'MomentumSum' , if someone could help that would be great, thanks
[英]I get this Error AttributeError at /listings/5689-resot-relly-market, 'Profile' object has no attribute 'favourite' please any help would be apprciate
我正在 django 中添加最喜欢的 function,当我点击保存按钮时,我一直收到此错误。 从这里看起来一切都很好,为什么我不能真正告诉错误来自哪里
模型.py
class Profile(models.Model):
user = models.OneToOneField(User, related_name='profile', on_delete=models.CASCADE)
...
favorite = models.ManyToManyField(Accomodation, related_name='profile')
我拼错了最喜欢的所以我改变了这一行
favorite = models.ManyToManyField(Accomodation, related_name='profile')
至
favourite = models.ManyToManyField(Accomodation, related_name='profile')
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.