I have a class Image
with the following GenericRelation
:
properties = models.GenericRelation(Property)
I'm trying to get all Images with certain properties, so I do this:
Image.objects.filter(properties__type = "foo", properties__user = request.user)
But this results in the following error:
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.
Is it not possible to query that way? What can I do as an alternative?