logo
  • 教程列表
  • SO官方文档
  • 使用 HStoreField 将字​​符串映射到字符串 - PostgreSQL 特定字段
    • 设置 HStoreField
    • 将 HStoreField 添加到模型中
    • 创建新的模型实例
    • 执行密钥查找
    • 使用包含
  1. StackOverflow 文档
  2. Django 教程
  3. 使用 HStoreField 将字​​符串映射到字符串 - PostgreSQL 特定字段
  4. 使用包含

使用包含

Created: November-22, 2018

将 dict 对象传递给 field_name__contains 作为关键字参数。

Catalog.objects.filter(titles__contains={
        'Pro Git': 'Scott Chacon and Ben Straub'})

相当于 SQL 运算符`@>`。

  • 执行密钥查找

Copyright © 2018. All right reserved

tastones.com 备案号:鲁ICP备18045372号-1

  • 关于我们
  • 免责声明