Skip to Content
Flask Web开发:基于Python的Web应用开发实战(第2版)
book

Flask Web开发:基于Python的Web应用开发实战(第2版)

by Miguel Grinberg
August 2018
Intermediate to advanced
230 pages
6h 42m
Chinese
O'Reilly Media, Inc. Beijing
Content preview from Flask Web开发:基于Python的Web应用开发实战(第2版)
数据库
49
类型名 Python类型 说 明
BigInteger
int
long
不限制精度的整数
Float float
浮点数
Numeric decimal.Decimal
定点数
String str
变长字符串
Text str
变长字符串,对较长或不限长度的字符串做了优化
Unicode unicode
变长
Unicode
字符串
UnicodeText unicode
变长
Unicode
字符串,对较长或不限长度的字符串
做了优化
Boolean bool
布尔值
Date datetime.date
日期
Time datetime.time
时间
DateTime datetime.datetime
日期和时间
Interval datetime.timedelta
时间间隔
Enum str
一组字符串
PickleType
任何
Python
对象 自动使用
Pickle
序列化
LargeBinary str
二进制
blob
db.Column
的其余参数指定属性的配置选项。表
5-3
列出了一些可用选项。
5-3:最常用的SQLAlchemy列选项
选项名 说 明
primary_key
如果设为
True
,列为表的主键
unique
如果设为
True
,列不允许出现重复的值
index
如果设为
True
,为列创建索引,提升查询效率
nullable
如果设为
True
,列允许使用空值;如果设为
False
,列不允许使用空值
default
为列定义默认值
Flask-SQLAlchemy
要求每个模型都定义
主键
,这一列经常命名为
id
虽然没有强制要求,但这两个模型都定义了 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Python机器学习基础教程

Python机器学习基础教程

Andreas C. Müller, Sarah Guido
Python编程入门与实战

Python编程入门与实战

Posts & Telecom Press, Fabrizio Romano
程序设计导论:Python语言实践

程序设计导论:Python语言实践

罗伯特 塞奇威克, 凯文 韦恩, 罗伯特 唐德罗

Publisher Resources

ISBN: 9787115489456