If quantity is an integer field, should you not use the exclude as: Place.objects.exclude(itemplace__quantity = 0) If this is not it, please show us the models.
Maeck On Dec 4, 4:58 am, Karantir <[EMAIL PROTECTED]> wrote: > Hi, > > I've just found strange django behaviour and want to understand is it > a bug or an inconvenient feature. I have two models -- Place and Item > bound through the intermediate table ItemPlace (that stores additional > field -- quantity). Physically it describes some quantity of items > lying on the some places. > > Then i've tried to fetch spare places with the following request: > Place.objects.filter(itemplace__quantity = None) and it works > perfectly. After that i've run Place.objects.exclude > (itemplace__quantity = None) to fetch occupied places but this request > anyway returns an empty list. > > Surely i can use Place.objects.filter(itemplace__quantity__gte = 0) > and it works but why the previous request fails? Any ideas? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---