MENU

PyCharm:Unresolved attribute reference 'objects'

概述

使用PyCharm开发Django应用时调用models的objects管理器对象会提示Unresolved attribute reference 'objects' for class 'xxx'

解决方法

在类中添加一行代码objects = models.Manager()即可

class Item(models.Model):
    # ......
    # def ...
    # ...
    objects = models.Manager()

文章标题:PyCharm:Unresolved attribute reference 'objects'
如果文中内容侵犯了您的权益,请及时与博主取得联系进行删除!
本站文章未经许可禁止转载,本文地址:https://blog.wanvale.com/archives/332/

Archives QR Code Tip
QR Code for this page
Tipping QR Code