私は次のクラス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.
そのようにクエリすることはできませんか?代替手段として何ができますか?