摘要:        
每个模型都有一个管理器,Manager 通过分页可以先加载一部分的数据内容,然后避免大量的查询带来的等待时间 应用场景是,排行榜,前十条或者 for i in range(100): ...: ...: list.append(User(username='duser{0}'.format(i),p    阅读全文
posted @ 2020-05-08 09:33
linux——quan
阅读(265)
评论(0)
推荐(0)
        
            
        
        
摘要:        
1、models.AutoField 自增列 = int(11) 如果没有的话,默认会生成一个名称为 id 的列 如果要显式的自定义一个自增列,必须设置primary_key=True。 2、models.CharField 字符串字段 必须设置max_length参数 3、models.Boole    阅读全文
posted @ 2020-05-08 00:01
linux——quan
阅读(1449)
评论(0)
推荐(0)
        
                    
                
浙公网安备 33010602011771号