#方式一# for i in range(1,4):# ga = "大数据{}班".format(i)# g = Grade(g_name = ga)# g.save()#方式二for i in range(1,4): ga = "大数据{}班".format(i) Grade.objects.create(g_name=ga)