我在Django的模型有泛型关系,我使用postgres作为我的数据库。 这是我的模特
Reaction(models.Model):
object_id = models.TextField(_('object ID'))
root_obj = GenericForeignKey(ct_field="content_type", fk_field="object_id")
react = models.CharField('Reaction', max_length=10)
class Blog(models.Model):
headline = models.TextField('headline')
data = GenericRelation(Reaction)
当我被一般关系过滤时(例如。Blog.objects.filter文件(react\uuu data=XX))我得到了这个错误:
operator does not exist: integer = text
HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts.
我认为有一个在这个链接修复,但我不知道该怎么办。 https://code.djangoproject.com/ticket/16055
谢谢!你知道吗
目前没有回答
相关问题 更多 >
编程相关推荐