簡體   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

我正在 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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM