惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

T
Tailwind CSS Blog
The GitHub Blog
The GitHub Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
B
Blog
Microsoft Security Blog
Microsoft Security Blog
Stack Overflow Blog
Stack Overflow Blog
量子位
Martin Fowler
Martin Fowler
月光博客
月光博客
P
Proofpoint News Feed
博客园_首页
Y
Y Combinator Blog
I
InfoQ
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
V
Visual Studio Blog
H
Help Net Security
U
Unit 42
GbyAI
GbyAI
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
博客园 - 司徒正美
MongoDB | Blog
MongoDB | Blog
F
Fortinet All Blogs
罗磊的独立博客
酷 壳 – CoolShell
酷 壳 – CoolShell

博客园 - 风来风往风伤(TiAmo)

CPU监控工具 桌面日历软件 no matching host key type found. Their offer: ssh-rsa报错信息具体方法 Spring_AOP 原理 增强类型 js漂浮代码 ThoughtWorks(中国)程序员读书雷达 Java实现文件的RSA和DES加密算法 二维码 编码原理简介 Maven+eclipse+svn项目构建 QtCreator中使用CMake+Ninja加速编译 error C1088: 无法刷新编译器中间文件 error C1041: 无法打开程序数据库“xxx\vc140.pdb”;如果要将多个 CL.EXE 写入同一个 .PDB 文件 - 风来风往风伤(TiAmo) Navicat key MICROSOFT SQL SERVER 2012 序列号 IT外包概要 RuntimeError: You called this URL via POST, but the URL doesn’t end in a slash and you have APPEND_SLASH set. QEventLoop配合QTimer实现阻塞任务超时处理 sql调优的总结 2019Python学习路线图
判断django中的orm为空
风来风往风伤(TiAmo) · 2019-06-10 · via 博客园 - 风来风往风伤(TiAmo)
result= Booking.objects.filter()
 
 
#方法一 .exists()
if result.exists():
    print "QuerySet has Data"
else:
    print "QuerySet is empty"
#方法二 .count()==0
if result.count() == 0:
    print "empty"
#方法三
if result:
    print "QuerySet has Data"
else:
    print "QuerySet is empty"
 
总结:
QuerySet.exists() > QuerySet.count()==0 > QuerySet