exclude and filter

13 views
Skip to first unread message

Pradip Caulagi

unread,
Jul 3, 2014, 4:40:02 AM7/3/14
to django...@googlegroups.com
What am I missing here? I would expect the last query to return (14389
- 2136) records below -

>>> Booking.objects.all().count()
14389
>>> Booking.objects.filter(id__in =
PriorToCheckout.objects.all().values_list('confirmation_call__booking__id',
flat=True)).count()
2136
>>> Booking.objects.exclude(id__in =
PriorToCheckout.objects.all().values_list('confirmation_call__booking__id',
flat=True)).count()
0
>>>

Thanks,
--
Pradip P Caulagi

monoBOT

unread,
Jul 3, 2014, 11:30:06 AM7/3/14
to django...@googlegroups.com

2014-07-03 9:39 GMT+01:00 Pradip Caulagi <ppc....@gmail.com>:
Booking.objects.exclude(id__in = PriorToCheckout.objects.all().values_list('confirmation_call__booking__id', flat=True)).count

​try:
Booking.objects.all().exclude(id__in = PriorToCheckout.objects.all().
values_list('confirmation_call__booking__id', flat=True)).count



--
monoBOT
Visite mi sitio(Visit my site): monobotsoft.es/blog/
Reply all
Reply to author
Forward
0 new messages