摘要: #_author:来童星#date:2020/4/19#循环实现评论数据结构comment_list=[ {"id":1,"content":"python最厉害","user":"来星星","parent_id":None}, {"id":2,"content":"GO最厉害","user":"来 阅读全文
posted @ 2020-04-19 22:26 Stary_tx 阅读(324) 评论(0) 推荐(0) 编辑
摘要: 字段用处: 1. admin中验证 2.obj.clean_fields() 3. (1) form组件验证 (2)model组件操作数据 username email 4.ModelForm ModelForm组件验证 用户models中的字段 model组件操作数据 username email 阅读全文
posted @ 2020-04-19 16:08 Stary_tx 阅读(165) 评论(0) 推荐(0) 编辑
摘要: models中代码: class Test(models.Model): username=models.CharField(max_length=32,) email=models.EmailField()views中代码: def test(req): obj=models.Test(name= 阅读全文
posted @ 2020-04-19 15:37 Stary_tx 阅读(195) 评论(0) 推荐(0) 编辑