django报错 type object ‘xxxxx’ has no attribute ‘object’

没有导入UserManager的包

from django.contrib.auth.models import UserManager

多见于新手,比如我

随后在class中写入

objects = UserManager()
使objects 拥有UserManager,随后利用函数名.objects.create(字段名="值")
for example :
def emp_add(request):
    Emp.objects.create(title="123")
    return render(request,'orm.html')

 

django报错 type object 'xxxxx' has no attribute 'object'django报错 type object 'xxxxx' has no attribute 'object' django报错 type object 'xxxxx' has no attribute 'object' django报错 type object 'xxxxx' has no attribute 'object'

给TA打赏
共{{data.count}}人
人已打赏
Django

django报错 type object 'xxxxx' has no attribute 'object'

2023-6-21 22:36:38

CSS

DIV盒子模型的总宽度与总高度

2021-11-9 23:40:53

0 条回复 A文章作者 M管理员
    暂无讨论,说说你的看法吧
个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索