'Negating IN/NOT IN not supported' in Djongo

41 views
Skip to first unread message

Esieboma Jeremiah

unread,
Mar 17, 2022, 12:48:21 PM3/17/22
to djongo
Hello everyone, 

I am using Djongo on a project and I am trying to add some exclude queries which are really vital to the application
e.g Thread.objects.all().exclude(status__icontains='sent')
but I keep getting  'Negating IN/NOT IN not supported' 

Please, is there a way around this ??

Thanks
Jeremiah.

Yinon Bloch

unread,
Mar 27, 2022, 3:20:10 AM3/27/22
to djongo
I have the same issue, did you manage to solve it?

Yinon Bloch

unread,
Mar 27, 2022, 3:46:11 AM3/27/22
to djongo
Here is my work around:

ids_to_ignore = Thread.objects.all().filter(status__icontains='sent')
Thread.objects.all().exclude(id__in=[x.id for x in ids_to_ignore])
Reply all
Reply to author
Forward
0 new messages