《Django 5 By Example》阅读笔记:p54-p75

《Django 5 By Example》学习第3天,p54-p75总结,总计22页。

一、技术总结

1.分页

(1)分页:Paginator

(2)页数不存在处理: EmptyPage, PageNotAnInteger

2.class-based views(类视图)

(1)为什么使用类视图?

1)Organize code related to HTTP methods, such as GET, POST, or PUT, in separate methods, instead of using conditional branching(使用类视图可以根据http请求方法来组织视图,而不是条件判断)。

2)Use multiple inheritance to create reusable view classes (also known as mixins)(使用多继承来实现视图复用)。

3.forms(表单)

主要是两类:Form, ModelForm。不过表单在实际的开发中用得较少。

二、英语总结(生词:2)

1.canonical

p55, Using canonical URLs for models.

(1)canon

c. a rule, principle or law.

(2)canonical

adj. according to a rule.

2.facilitate

(1)facilitate: facili(“easy to do”),

vt. to make sth easier(促进). p76, To facilitate the separation of configuration from code, we are going to use python-decouple.

三、其它

今天没有什么想说的。

四、参考资料

1. 编程

(1) Antonio Melé,《Django 5 By Example》:https://book.douban.com/subject/37007362/

2. 英语

(1) Etymology Dictionary:https://www.etymonline.com

(2) Cambridge Dictionary:https://dictionary.cambridge.org
在这里插入图片描述

欢迎搜索及关注:编程人(a_codists)

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值