简体   繁体   English

我在 /listings/5689-resot-relly-market 收到此错误 AttributeError,'Profile' object 没有属性 'favourite' 请提供任何帮助

[英]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.

相关问题 我得到一个 AttributeError: 'Particle' object has no attribute 'MomentumSum',如果有人能提供帮助,那就太好了,谢谢 - I get thrown a AttributeError: 'Particle' object has no attribute 'MomentumSum' , if someone could help that would be great, thanks /addtowatchlist/5 处的 AttributeError:“QuerySet”object 没有属性“listings” - AttributeError at /addtowatchlist/5: 'QuerySet' object has no attribute 'listings' 请帮助:AttributeError: 'str' object 没有属性 'write' - please help :AttributeError: 'str' object has no attribute 'write' 任何人都可以帮我找到错误“AttributeError:'Example' object has no attribute 'src_len'”的解决方案吗? - Can Anyone please help me in finding the solution to the error "AttributeError: 'Example' object has no attribute 'src_len'"? 我收到此错误 --> AttributeError: 'NoneType' object has no attribute 'predict' - I get this error --> AttributeError: 'NoneType' object has no attribute 'predict' 我得到的错误是 AttributeError: 'NoneType' object has no attribute 'date' - The error that I get is AttributeError: 'NoneType' object has no attribute 'date' 需要帮助修复此错误:AttributeError: 'int' object 没有属性 'cget' - Need help fixing this Error: AttributeError: 'int' object has no attribute 'cget' /profile/ 'function' 对象的 AttributeError 没有属性 'object - AttributeError at /profile/ 'function' object has no attribute 'object Django AttributeError at /accounts/profile/ 'User' object has no attribute 'get' while update profile - Django AttributeError at /accounts/profile/ 'User' object has no attribute 'get' while update profile 我收到此错误 AttributeError: 'function' object has no attribute 'hlauncher' while试图从另一个文件中获取属性 - I got this error AttributeError: 'function' object has no attribute 'hlauncher' while trying to get a attribute from another file
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM