我的模特:
from django.contrib.postgres.fields import JSONField
class Image(models.Model):
tags = JSONField(null=False, blank=True, default={})
标签字段值可以为空,或类似:
[
{"tag": "xxx", "invalid": "true"},
{"tag": "yyy"},
{"tag": "zzz"}
]
我需要创建一个查询,向我提供图像对象,其中tags
列中的所有对象具有"无效"键集" true"。
谢谢你的帮助
答案 0 :(得分:0)