上一页 1 ··· 11 12 13 14 15 16 17 18 19 ··· 45 下一页
摘要: 参考: 1 django orm create 阅读全文
posted @ 2023-06-26 09:23 tslam 阅读(5) 评论(0) 推荐(0) 编辑
摘要: from xpinyin import Pinyin可以看源码: 其中有各种关于该包的用法示例: zh_hans = '我是中国人'o = Pinyin()res = o.get_pinyin(zh_hans, '')print(f'res:{res}') 阅读全文
posted @ 2023-06-21 14:31 tslam 阅读(15) 评论(0) 推荐(0) 编辑
摘要: 如题 阅读全文
posted @ 2023-06-20 16:25 tslam 阅读(2) 评论(0) 推荐(0) 编辑
摘要: content_disposition = response对象.headers.get("content-disposition") 阅读全文
posted @ 2023-06-20 09:59 tslam 阅读(279) 评论(0) 推荐(0) 编辑
摘要: 如下 在项目中全局搜索FileResponse可找见 class ExportPlugin(BaseAdminPlugin): export_mimes = {'xlsx': 'application/vnd.ms-excel', 'xls': 'application/vnd.ms-excel', 阅读全文
posted @ 2023-06-20 09:57 tslam 阅读(21) 评论(0) 推荐(0) 编辑
摘要: 1 先从内存中查找 2 再从内置模块中查找 3 再从python解释器系统中key为path的环境变量中从上往下查找, 找到一个就结束. 都没找到则报错. py文件命名注意: 不要与 内置模块名冲突. 阅读全文
posted @ 2023-06-14 20:53 tslam 阅读(13) 评论(0) 推荐(0) 编辑
摘要: views.py 重写 list方法 阅读全文
posted @ 2023-06-13 19:46 tslam 阅读(10) 评论(0) 推荐(0) 编辑
摘要: 鼠标点击ValidationError(), 再点击PyCharm右侧对应两个按钮, 找见源码 如下 结论: 你可以直接传dict 或 list内容 阅读全文
posted @ 2023-06-13 16:59 tslam 阅读(18) 评论(0) 推荐(0) 编辑
摘要: 分析: 我们返回给前端的是Response对象, 要给Response加减内容,首先得找见它. 所以步骤是 1.1 找见Response 1.2 给Response添加/减少/改变东西, 返回新的Response 1.1 返回Response 位置 -> 五个视图扩展类里 from rest_fra 阅读全文
posted @ 2023-06-13 15:54 tslam 阅读(30) 评论(0) 推荐(0) 编辑
摘要: 有对应的excel协议, 具体: 前端掉 excel协议+文件地址即可,你只需要把 文件地址 返回即可. 背景: http协议: http"//www.baidu.com https协议 ftp协议 所以,对应的有 Excel协议 阅读全文
posted @ 2023-06-12 09:27 tslam 阅读(51) 评论(0) 推荐(0) 编辑
上一页 1 ··· 11 12 13 14 15 16 17 18 19 ··· 45 下一页