I have quite long query with 'Q()', with Sqlite3
works very well, but with postgresql
or mysql
I have strange error e.g. for postgresql: invalid input syntax for integer: "("
and for mySQL: Truncated incorrect DOUBLE value: '('
How could I run that query with mysql? Where is my mistake?
Here is that query:
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()