2020年12月28日

摘要: sha1生成一个160bit的结果,通常用40位的16进制字符串表示实际使用过程中,可以(不推荐)将40位16进制的字符串转换位10进制,并取后10位 def str_hash_to_int(s, end=10): return int(hashlib.sha1(s.encode('utf-8')) 阅读全文
posted @ 2020-12-28 11:36 Arron_Ramsey 阅读(68) 评论(0) 推荐(0) 编辑

2020年12月25日

摘要: 1.计算字符串长度 2.判断字符串大小 3.选取部分字符串 {% if group|length > 10 %} <span>{{group|slice:10}}</span> {% else %} <span>{{group}}</span> {% endif %} <span> {{month| 阅读全文
posted @ 2020-12-25 14:32 Arron_Ramsey 阅读(427) 评论(0) 推荐(0) 编辑

2020年12月23日

摘要: <form class="navbar-form" action="" method="post"> <div class="time"> <span>time :</span> <div class="form-group form-inline" role="group" aria-label= 阅读全文
posted @ 2020-12-23 11:30 Arron_Ramsey 阅读(162) 评论(0) 推荐(0) 编辑
 
摘要: <div class="container-fluid"> <style onload="alert('大部负责人,小组负责人,销售姓名请使用花名,禁止使用真实姓名,\n你可以通过下载<下载当前权限>来快速分配权限.')"> </style> </div> 阅读全文
posted @ 2020-12-23 11:02 Arron_Ramsey 阅读(335) 评论(0) 推荐(0) 编辑

2020年12月18日

摘要: 提交表单后重定向的标准做法是防止重复。 只需在成功后将重定向返回到您的表单即可。 if form.is_valid(): form.save() return http.HttpResponseRedirect('/your_url/') 阅读全文
posted @ 2020-12-18 15:17 Arron_Ramsey 阅读(261) 评论(0) 推荐(0) 编辑

2020年12月11日

摘要: 1.判定字符串中是否含有中文 2.判定是否是真实姓名 3.提取字符串中的中文 4.过滤掉字符串中的中文 # 检查是否带有中文字符 import re def check_contain_chinese(check_str): for ch in check_str: if u'\u4e00' <= 阅读全文
posted @ 2020-12-11 15:26 Arron_Ramsey 阅读(208) 评论(0) 推荐(0) 编辑
 
摘要: 1.循环pd.DataFrame和行 2.为行添加函数 3.当显示{pd.DataFrame}为空时显示其他项 4.奇数和偶数行不一样上色 <table class="table table-hover"> <tr> <th>站点</th> <th>销售</th> <th>广告对接人</th> <t 阅读全文
posted @ 2020-12-11 14:22 Arron_Ramsey 阅读(402) 评论(0) 推荐(0) 编辑

2020年12月4日

摘要: <style> tr th { background-color:red; position: sticky; top:0; (距离顶部的距离)(这个距离必须要指定,不然表头不会固定) } </style> <table class="table"> <thead style="background 阅读全文
posted @ 2020-12-04 17:34 Arron_Ramsey 阅读(156) 评论(0) 推荐(0) 编辑

2020年12月3日

摘要: 推荐使用FileResponse,从源码中可以看出FileResponse是StreamingHttpResponse的子类,内部使用迭代器进行数据流传输。 在实际的项目中很多时候需要用到下载功能,如导excel、pdf或者文件下载,当然你可以使用web服务自己搭建可以用于下载的资源服务器, 如ng 阅读全文
posted @ 2020-12-03 09:39 Arron_Ramsey 阅读(134) 评论(0) 推荐(0) 编辑

2020年11月30日

摘要: 1. 获得某class的所有对象的方法: (返回的是数组) 这里我是绑定到a链接上 var links = document.querySelectorAll("ul > li > a"); 或是通过getElementById getElementsByTagName来获取元素 2. for循环给 阅读全文
posted @ 2020-11-30 10:07 Arron_Ramsey 阅读(1921) 评论(0) 推荐(0) 编辑