zl程序教程

您现在的位置是:首页 >  后端

当前栏目

django models使用学习记录

django学习 记录 Models 使用
2023-09-27 14:26:13 时间

如何更新单个数据

example = User.objects.get(id=1)

example.is_acitve=1

example.save()

如何更新多个数据

examples = User.objects.filter(is_staff=1).update(is_superuser=1)