Django1.8文档阅读手记
主要集中在新特性上。
Django1.8好像开始推荐使用python3
Django的QuerySet是延迟加载的,这个文档里面一般会明言,通过Connection SQL显示测试,外键对象也是延迟加载的。
Django1.8的get filter等方法继续在aptana pydev下error:undefined variables from import,不过收费的pycharm似乎解决自django1.7以后出现的这个问题。
Web development is often broad, not deep – problems span many domains.
One-to-one relationships:This is most useful on the primary key of an object when that object “extends” another object in some way.It is Model inheritance too.
A field name cannot contain more than one underscore in a row, due to the way Django’s query lookup syntax works
limiting the queryset using an array slice or an index will not populate the cache.
If you need to execute more complex queries (for example, queries with OR statements), you can use Q objects.
Note that delete() is the only QuerySet method that is not exposed on a Manager itself. This is a safety mechanism to prevent you from accidentally requesting Entry.objects.delete(), and deleting all the entries.
Forward access to one-to-many relationships is cached the first time the related object is accessed.
对Model层的重新认识,以前一直认为Django的Model层不过是一个Active Record模式的Data Access Layer层,最近重新通篇阅读Guide文档,发现认识有所不足:它不仅是一个自下而上设计实现的数据访问设施,而且是一个面向领域业务模型自上而下设计的模型实现层.
However, when a values() clause is used to constrain the columns that are returned in the result set, the method for evaluating annotations is slightly different. Instead of returning an annotated result for each result in the original QuerySet, the original results are grouped according to the unique combinations of the fields specified in the values() clause.
Class inheritance and model managers aren’t quite a perfect match for each other.
Avoid catching exceptions inside atomic!
As well as caching of the whole QuerySet, there is caching of the result of attributes on ORM objects. In general, attributes that are not callable will be cached,But in general, callable attributes cause DB lookups every time.
Django1.8文档阅读手记的更多相关文章
- Node.js的下载、安装、配置、Hello World、文档阅读
Node.js的下载.安装.配置.Hello World.文档阅读
- 我的Cocos Creator成长之路1环境搭建以及基本的文档阅读
本人原来一直是做cocos-js和cocos-lua的,应公司发展需要,现转型为creator.会在自己的博客上记录自己的成长之路. 1.文档阅读:(cocos的官方文档) http://docs.c ...
- 转:苹果Xcode帮助文档阅读指南
一直想写这么一个东西,长期以来我发现很多初学者的问题在于不掌握学习的方法,所以,Xcode那么好的SDK文档摆在那里,对他们也起不到什么太大的作用.从论坛.微博等等地方看到的初学者提出的问题,也暴露出 ...
- Keras 文档阅读笔记(不定期更新)
目录 Keras 文档阅读笔记(不定期更新) 模型 Sequential 模型方法 Model 类(函数式 API) 方法 层 关于 Keras 网络层 核心层 卷积层 池化层 循环层 融合层 高级激 ...
- Django文档阅读-Day1
Django文档阅读-Day1 Django at a glance Design your model from djano.db import models #数据库操作API位置 class R ...
- Django文档阅读-Day2
Django文档阅读 - Day2 Writing your first Django app, part 1 You can tell Django is installed and which v ...
- Django文档阅读-Day3
Django文档阅读-Day3 Writing your first Django app, part 3 Overview A view is a "type" of Web p ...
- Silverlight类百度文库在线文档阅读器
百度文库阅读器是基于Flash的,用Silverlight其实也可以做. 我实现的在线阅读器可以应用于内网文档发布,在线阅览审批等.没有过多的堆积功能,专注于核心功能.主要有以下特性: 1. 基于XP ...
- 苹果Xcode帮助文档阅读指南
文档导读 https://developer.apple.com/legacy/library/navigation/ 前面我们讲Xcode的文档结构是在介绍如何能够快速定位到你要找的内容.但是很多人 ...
随机推荐
- SQL join 语句 画图果然更容易理解
我认为 Ligaya Turmelle 的关于SQL联合(join)语句的帖子对于新手开发者来说是份很好的材料.SQL 联合语句好像是基于集合的,用韦恩图来解释咋一看是很自然而然的.不过正如在她的帖子 ...
- 【一天一道LeetCode】#95. Unique Binary Search Trees II
一天一道LeetCode 本系列文章已全部上传至我的github,地址:ZeeCoder's Github 欢迎大家关注我的新浪微博,我的新浪微博 欢迎转载,转载请注明出处 (一)题目 Given a ...
- TableEdit UI_10
1.tableView的编辑的步骤: 1.让tableView处于编辑状态,(默认所有的cell都处于编辑状态,默认下的编辑样式是删除) 2.设置哪些cell可以编辑 3.设置编辑的样式(删除,插 ...
- 安装Compass时不能访问服务器的问题
今天安装Compass,居然老是提示网络问题,后来根据错误提示,发现带https的域名是访问不了的,是是SSL问题.后来搜了一下,在stackoverflow找到一个人说,将https的去掉就好了.具 ...
- linux shell编程语句if、case.
shell学习笔记--if,case shell的控制流结构主要有if语句.for语句.case语句.while语句.until语句这五种,在shell中这些语句的用法有点类似C语言,很容易学会,但也 ...
- 敏捷测试(2)--ATDD概念
什么是验收测试驱动开发 在准备实施一个功能或特性之前,首先团队需要定义出期望的质量标准和验收细则,以明确而且达成共识的验收测试计划(包含一系列测试场景)来驱动开发人员的TDD实践和测试人员的测试脚本开 ...
- 手把手带你做一个超炫酷loading成功动画view Android自定义view
写在前面: 本篇可能是手把手自定义view系列最后一篇了,实际上我也是一周前才开始真正接触自定义view,通过这一周的练习,基本上已经熟练自定义view,能够应对一般的view需要,那么就以本篇来结尾 ...
- JavaScript进阶(五)js中取小数整数部分函数
js中取小数整数部分函数 丢弃小数部分,保留整数部分 js:parseInt(7/2) 向上取整,有小数就整数部分加1 js: Math.ceil(7/2) 四舍五入 js: Math.round(7 ...
- 为什么要使用“var me=this”这样的写法
很多人都会奇怪,为什么在Ext JS 4中会大量使用"var me=this"这样的写法,其实,在官方论坛以下地址的帖子已经给出了很好的说明: http://www.sencha. ...
- windows下追踪路由
追踪路由 tracert 目标ip/域名 测试两个ip是否畅通 ping 目标ip 在windows查看ip情况 ipconfig linux/unix下查看ip情况的使用 ifconfig