Advertisement

Python百日进阶 Web 开发 Peewee Day 284 数据库扩展 PostgreSQL 三

阅读量:

文章结构概览

      • 13.6.3 应用 hstore
        • 13.6.4 时间间隔支持 Interval support
        • 13.6.5 服务器端光标 Server-side cursors
        • 13.6.6 全文检索 Full-text search
        • 13.6.7 postgres_ext API 功能说明
          • ServerSide
      • 类 ArrayField
      • 类 DateTimeTZField
      • 类 HStoreField
      • 类 JSONField
      • 类 BinaryJSONField
      • 匹配操作 Match
      • 类 TSVectorField

13.6.3 使用 hstore

首先,应从其中引入自定义数据库类以及 hstore 函数 playhouse.postgres_ext(详见上方的代码片段)。接下来,在模型中添加 a 的操作就如同使用 HStoreField 一般简便:

复制代码
    class House(BaseExtModel):
    address = CharField()
    features = HStoreField()

全部评论 (0)

还没有任何评论哟~