摘要: 1、models.AutoField 自增列 = int(11) 如果没有的话,默认会生成一个名称为 id 的列,如果要显示的自定义一个自增列,必须将给列设置为主键 primary_key=True。 2、models.CharField 字符串字段 必须 max_length 参数 3、model 阅读全文
posted @ 2017-04-25 16:55 隔壁Mr.Wang 阅读(88) 评论(0) 推荐(0) 编辑
摘要: {{ name | lower}} <!-- 小写 --> {{ name |truncatewords:30 }} <!-- 只显示 content 变量的前30个词 --> {{ value|default:"nothing" }} <!--如果一个变量是false或者为空,使用给定的默认值。否 阅读全文
posted @ 2017-04-25 16:29 隔壁Mr.Wang 阅读(71) 评论(0) 推荐(0) 编辑
摘要: # 多线程 from concurrent.futures import ThreadPoolExecutor # 多进程 from concurrent.futures import ProcessPoolExecutor import time def task(i): print(i) time.sleep(1) pool = ThreadPoolExecutor(1... 阅读全文
posted @ 2017-04-25 13:51 隔壁Mr.Wang 阅读(253) 评论(0) 推荐(0) 编辑