随笔 - 192,  文章 - 1,  评论 - 6,  阅读 - 51476
09 2021 档案
django使用bulk_update批量更新数据
摘要:一、第一步,导入bulk_update包from bulk_update.helper import bulk_update二、写一个类 class CommonQuerySet(models.QuerySet): def bulk_update(self, objs, update_fields= 阅读全文
posted @ 2021-09-13 11:17 輪滑少年 阅读(6190) 评论(0) 推荐(0) 编辑
python 链接mysql数据库,进行sql查询
摘要:一、需要在.env中配置数据库的主机地址,账号,密码,端口号等信息 二、写查询函数 from django.db.utils import ConnectionHandler connections = ConnectionHandler() def rule_dos(self): """ 拿到ru 阅读全文
posted @ 2021-09-13 11:10 輪滑少年 阅读(376) 评论(0) 推荐(0) 编辑

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

点击右上角即可分享
微信分享提示