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的文档结构是在介绍如何能够快速定位到你要找的内容.但是很多人 ...
随机推荐
- iOS中 UISearchController 搜索栏 UI技术分享
<p style="margin-top: 0px; margin-bottom: 0px; font-size: 20px; font-family: 'STHeiti Light' ...
- 图文浅析Binder机制
总述: Binder是Android系统提供的一种IPC机制,Android系统基本就可以看做基于Binder的C/S架构,Binder也是C/S形式出现,它属于驱动但是驱动的一段内存而不是设备,框架 ...
- Android进阶(五)在Eclipse中关联Gson源码
1)获得相应的jar包gson-2.2.4-sources.jar与gson-2.2.4-javadoc.jar. 2)在libs目录下新建src包和docs包,将相应jar包放入相应文件夹内. 3) ...
- sed-加速你在Linux的文件编辑
1. Sed简介 sed是一种在线编辑器,它一次处理一行内容.处理时,把当前处理的行存储在临时缓冲区中,称为"模式空间"(pattern space),接着用sed命令处理缓冲区中 ...
- javascript之DOM文档对象模型编程的引入
/* DOM(Document Object Model) 文档对象模型 一个html页面被浏览器加载的时候,浏览器就会对整个html页面上的所有标签都会创建一个对应的 对象进行描述,我们在浏览器上看 ...
- android studio中使用lambda
环境准备 如果还没有安装Java 8,那么你应该先安装才能使用lambda和stream(译者建议在虚拟机中安装,测试使用). 像NetBeans 和IntelliJ IDEA 一类的工具和IDE就支 ...
- Leetcode_66_Plus One
本文是在学习中的总结,欢迎转载但请注明出处:http://blog.csdn.net/pistolove/article/details/41652987 Plus One Given a non-n ...
- android 加载图片oom若干方案小结
本文根据网上提供的一些技术方案加上自己实际开发中遇到的情况小结. 众所周知,每个Android应用程序在运行时都有一定的内存限制,限制大小一般为16MB或24MB(视手机而定).一般我们可以通过获取当 ...
- Java-ServletInputStream
import java.io.InputStream; import java.io.IOException; /** * Provides an input stream for reading b ...
- 文档流 css中的float clear与布局
文档流 先说说什么是文档流 流是什么 就是一串连续的东西 <div style="background-color:pink;width:40px;height:80px;" ...