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的文档结构是在介绍如何能够快速定位到你要找的内容.但是很多人 ...
 
随机推荐
- Mybatis插件原理分析(一)
			
我们首先介绍一下Mybatis插件相关的几个类,并对源码进行了简单的分析. Mybatis插件相关的接口或类有:Intercept.InterceptChain.Plugin和Invocation,这 ...
 - 11.2、Libgdx的音频之音乐
			
(官网:www.libgdx.cn) 对于任何超过5秒的声音来说,最好将其放到磁盘中而不是内存中.Libgdx提供了一个Music接口来帮我们实现. 以下载入Music实例: Music music ...
 - Socket编程实践(8) --Select-I/O复用
			
五种I/O模型介绍 (1)阻塞I/O[默认] 当上层应用App调用recv系统调用时,如果对等方没有发送数据(Linux内核缓冲区中没有数据),上层应用Application1将阻塞;当对等方发送了数 ...
 - React Native之AppRegistry模块
			
我们在写react native的js的时候,在最后总会加上一段代码: AppRegistry.registerComponent('ReactDemo', () => ReactDemo); ...
 - SQL2008数据表空间大小查询脚本
			
--尽量少用触发器,否则数据库增长很快,特别是关于登陆的数据表字段不要用出发器,一周左右能使得数据库增长1G的空间. --数据库表空间大小查询脚本 IF EXISTS (SELECT * FROM ...
 - FSM之SMC使用总结
			
FSM之SMC使用总结 Part1: Smc.jar state machine compiler usage Reference: http://smc.sourceforge.net/ ...
 - 《java入门第一季》之面向对象面试题(fianl关键字)
			
/* 面试题:final修饰局部变量的问题 基本类型:基本类型的值不能发生改变. 引用类型:引用类型的(地址值)(不能发生改变),但是,该对象的堆内存的值是可以改变的. */ class Studen ...
 - ssh命令大全
			
常用格式:ssh [-l login_name] [-p port] [user@]hostname 更详细的可以用ssh -h查看. 举例 不指定用户: ssh 192.168.0.11 指定用户: ...
 - LeetCode之“数学”:Reverse Integer && Reverse Bits
			
1. Reverse Integer 题目链接 题目要求: Reverse digits of an integer. Example1: x = 123, return 321 Example2: ...
 - 携程Android App的插件化和动态加载框架
			
携程Android App的插件化和动态加载框架已上线半年,经历了初期的探索和持续的打磨优化,新框架和工程配置经受住了生产实践的考验.本文将详细介绍Android平台插件式开发和动态加载技术的原理和实 ...