《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)

相关推荐
sg_knight1 分钟前
设计模式实战:策略模式(Strategy)
java·开发语言·python·设计模式·重构·架构·策略模式
飞Link10 分钟前
告别 ROS 的臃肿:用 ZeroMQ 构建极速具身智能分布式大脑(附 Python 实战)
开发语言·分布式·python
嫂子的姐夫12 分钟前
039-DES:gov招标(解密)
爬虫·python·js逆向·逆向
jgyzl15 分钟前
2026.3.20 用EasyExcel实现excel报表的导入与导出
java·python·excel
weixin_4331793323 分钟前
python - 正则表达式Regex
python·正则表达式
Riemann~~29 分钟前
ros2写一个可以修改参数的node
开发语言·python·ros2·机器人系统
郝学胜-神的一滴30 分钟前
PyTorch 张量基础:零张量/一张量/指定值张量全解析
人工智能·pytorch·python
7yewh30 分钟前
Dense / 全连接层 / Gemm — 综合全局特征理解与运用
网络·人工智能·python·深度学习·cnn
工业互联网专业35 分钟前
基于Python的黑龙江旅游景点数据分析系统的实现_flask+spider
python·flask·vue·毕业设计·源码·课程设计·spider
进击的小头42 分钟前
第14篇:MPC控制案例——无人机高度控制
python·算法·无人机