我有以下Image
课程GenericRelation
:
properties = models.GenericRelation(Property)
我正在尝试获取具有某些属性的所有图像,所以我这样做:
Image.objects.filter(properties__type = "foo", properties__user = request.user)
但这会导致以下错误:
DatabaseError: operator does not exist: integer = text
LINE 1: ...perties_property" ON ("myapp_image"."id" = "propert...
^
HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts.
不能这样查询吗?我能做些什么作为替代方案?