django get_or_create int()参数必须是字符串,类似字节的对象或数字,而不是“元组”

时间:2018-07-18 17:39:39

标签: python django

尝试使用get_or_create时出现此错误 int()参数必须是字符串,类似字节的对象或数字,而不是“元组”

for ubc in Ubc.objects.all():
        professional_grade, created = ProfessionalGrade.objects.get_or_create(ubc=ubc)
        if created:
            professional_grade.category=0,
            professional_grade.category_name="BRUTA"
        professional_grade.experts = 0
        professional_grade.coordinators = 0
        professional_grade.seniors = 0
        professional_grade.researchers = 0
        professional_grade.plenos = 0
        professional_grade.experience = 0
        professional_grade.masters = 0
        professional_grade.doctors = 0
        professional_grade.save()

0 个答案:

没有答案