摘要: 必知必会13条 all *** # 取出所有 Book.objects.all().delete() ##删除所有对象 删除数据记录 filter *** # 过滤 Book.objects.filter(pk=1).update(price=190) 修改主键为1的书籍对象,的字段price为19 阅读全文
posted @ 2020-06-25 22:39 jalen-tian 阅读(194) 评论(0) 推荐(0) 编辑
该文被密码保护。 阅读全文
posted @ 2020-06-25 22:27 jalen-tian 阅读(0) 评论(0) 推荐(0) 编辑
摘要: 1.导入模块包 from django.db import transaction 2.设置回滚点 with transaction.atomic(): save_id = transaction.savepoint() # 设置回滚点 try: order = Order.objects.crea 阅读全文
posted @ 2020-06-25 16:23 jalen-tian 阅读(767) 评论(0) 推荐(0) 编辑
摘要: 1.在settings中进行设置, # 项目中存储上传文件的根目录[暂时配置],注意,uploads目录需要手动创建否则上传文件时报错MEDIA_ROOT=os.path.join(BASE_DIR,"uploads")# 访问上传文件的url地址前缀MEDIA_URL ="/media/" 2.m 阅读全文
posted @ 2020-06-24 15:24 jalen-tian 阅读(361) 评论(0) 推荐(0) 编辑
该文被密码保护。 阅读全文
posted @ 2020-06-24 00:02 jalen-tian 阅读(0) 评论(0) 推荐(0) 编辑
该文被密码保护。 阅读全文
posted @ 2020-06-21 23:54 jalen-tian 阅读(0) 评论(0) 推荐(0) 编辑
摘要: 1.常用命令 1.修改计算机命令 hostnamectl set-hostname qish 2.查看当前工作目录 pwd 3.查看ip命令 ifconfig ipconfig4.关机命令shutdowninit 05.创建文件夹touch test.py 增 touch test.py ##创建文 阅读全文
posted @ 2020-06-21 21:06 jalen-tian 阅读(107) 评论(0) 推荐(0) 编辑
该文被密码保护。 阅读全文
posted @ 2020-06-21 20:50 jalen-tian 阅读(0) 评论(0) 推荐(0) 编辑
该文被密码保护。 阅读全文
posted @ 2020-06-21 20:48 jalen-tian 阅读(0) 评论(0) 推荐(0) 编辑
摘要: 1.完整的mysql查询命令 # sql 查询语句完整语法: # select ... from .... where ... group by ... having ... order by ... limit .... 2.where条件有哪些 # 一.where 条件的使用 """功能:对表中 阅读全文
posted @ 2020-06-21 20:46 jalen-tian 阅读(130) 评论(0) 推荐(0) 编辑