Django框架使用时候报type object 'BookInfo' has no attribute 'objects'

具体原因如下

在django框架中模型models里面使用自定义管理,从而导致默认objects被替代了,所以会报错,还有一种就是写错了大家都知道

models

Django框架使用时候报type object 'BookInfo' has no attribute 'objects'

解决该错误的方法:
1.把books = BookInfoManager()注释掉
2.或者将objects改为books
Django框架使用时候报type object 'BookInfo' has no attribute 'objects'

相关文章:

  • 2021-04-03
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-06-05
  • 2022-12-23
  • 2022-12-23
  • 2022-02-13
  • 2022-01-04
  • 2022-01-22
  • 2022-12-23
相关资源
相似解决方案