我对'Q()'进行了很长的查询,Sqlite3
效果很好,但是postgresql
我mysql
遇到了奇怪的错误,例如对于postgresql:invalid input syntax for integer: "("
和对于mySQL:Truncated incorrect DOUBLE value: '('
如何使用 mysql 运行该查询?我的错误在哪里?
这是该查询:
watchersTuple = self.getWatchers()
tagsTuple = self.getTags()
blockedUserTuple = self.getBlockedUser()
blockedTagTuple = self.getBlockedTag()
statuses = Status.objects.filter( (Q(author__in = str(watchersTuple)) | Q(tags__in = str(tagsTuple)) | Q(author = self) | Q(recipient = self)) & ~Q(author__in = str(blockedUserTuple)) & ~Q(tags__in = str(blockedTagTuple)) ).distinct()