官术网_书友最值得收藏!

Chapter 2. Relational Databases with SQLAlchemy

Relational databases are the bedrock upon which almost every modern Web application is built. Learning to think about your application in terms of tables and relationships is one of the keys to a clean, well-designed project. As you will see in this chapter, the data model you choose early on will affect almost every facet of the code that follows. We will be using SQLAlchemy, a powerful object relational mapper that allows us to abstract away the complexities of multiple database engines, to work with the database directly from within Python.

In this chapter, we shall:

  • Present a brief overview of the benefits of using a relational database
  • Introduce SQLAlchemy, the Python SQL Toolkit and Object Relational Mapper
  • Configure our Flask application to use SQLAlchemy
  • Write a model class to represent blog entries
  • Learn how to save and retrieve blog entries from the database
  • Perform queries – sorting, filtering, and aggregation
  • Build a tagging system for blog entries
  • Create schema migrations using Alembic
主站蜘蛛池模板: 平塘县| 靖宇县| 水城县| 略阳县| 六枝特区| 峨边| 昆山市| 新宾| 凭祥市| 岳阳县| 滁州市| 平乐县| 十堰市| 那曲县| 沐川县| 时尚| 应用必备| 乌鲁木齐市| 林口县| 青浦区| 双牌县| 靖安县| 图片| 剑河县| 民县| 特克斯县| 监利县| 富源县| 兴义市| 赤壁市| 黎平县| 高台县| 海南省| 德阳市| 贡嘎县| 山阳县| 贡山| 定西市| 来宾市| 定日县| 弥勒县|