tags:

views:

69

answers:

2

I don't understand is it normal or it's time to create new django's ticket?

In [17]: User.objects.filter(pk=0)
Out[17]: []

In [18]: User.objects.filter(pk=0).exists()
Out[18]: True

The exists() should return False result in this case, I think. This is revision 11653 (Development version)

I have related problem with unique validating of inlineformset and I found that the reason is queryset.exists() doesn't work correctly

+2  A: 

You can use User.objects.filter(pk=0).count() to check if objects matching your filters exist

barbuza
+1  A: 

It was a bug, that was fixed in 11654 changeset

ramusus