Django_数据库增删改查——改和删
# 批量修改 models.Account.objects.filter(username='elina').update(password="Luffy#21") # 单条修改 obj = models.Account.objects.get(username='linux') obj.username = 'python' obj.save() # 批量删除 models.User.objects.get(password='oldboy').delete() # 单条删除 obj = models.User.objects.get(id=3) obj.delete()