My Blogs

K12 English

Tags: K12 , English

Published 2023年01月28日 22:00 by james

K12 英语知识点总结

疑问词

疑问代词

疑问形容词

(what、which、whose) + 名词

疑问副词

常见组合

十二生肖

🐁 🐂 🐅 🐇 🐉 🐍
Rat Ox Tiger Hare …

Django Best Practices: Models

Tags: Django , Python

Published 2022年12月08日 02:05 by james

Properly defining database models is arguably the most important part of a new project, however Django provides us with tremendous flexibility around how we structure our models.

There is an …

Python语言的指导原则

Tags: Python , 原则 , PEP

Published 2022年06月30日 17:00 by james

Guido van Rossum发明了Python,并确立了Python的指导原则,他被社区称为仁慈的独裁者(Benevolent Dictator For Life,BDFL)。 Tim Peters把这些原则写成了一段偈语,让我们一句一句来解释。

Django设计理念

Tags: Django , Python , 设计模式

Published 2022年04月10日 12:00 by james

TL;DR

详情

总体

松耦合

Django栈的基本目标是低耦合高内聚。框架里的不同层(Layers)不应该知道对方的代码,除非它们确实需要。

例如,模板系统不需要知道用户的Web请求,数据库层不需要了解如果显示数据,而视图并不关心程序员所使用的模板系统。

尽管为了方便Django带有一个完整的堆栈,但堆栈的各个部分尽可能独立于另一个堆栈。

更少的代码

Django应用的代码应该尽可能地精简,Django应该充分利用Python的动态能力,比如自省机制(introspection)。 …

事务

Tags: 事务 , 一致性 , WAL

Published 2022年03月31日 00:00 by james

事务

TL;DR