Re: Django 1.6RC1 exclude behavior change

2013-11-04 Thread jgastal
I was going to file a ticket in trac about this and found this one( https://code.djangoproject.com/ticket/21192) which seems related. The thing is that one was supposedly resolved 5 weeks ago, which would mean that fix would be in 1.6rc1... Should I reopen that ticket or file a new one? On Monda

Re: Django 1.6RC1 exclude behavior change

2013-11-04 Thread jgastal
I managed to get the desired behavior by doing the following ugly query: q_obj = (Q(a__confirmation=True) & Q(a__state=1)) | (Q(a__state__gt=1) & Q(a__state__lt=1)) bees = B.objects.filter(q_obj) This is obviously not an ideal solution but is working for me so far... On Monday, November 4, 2013

Re: Django 1.6RC1 exclude behavior change

2013-11-04 Thread jgastal
Anssi, Thanks for helping. I'm sorry to say that your answer went somewhat over my head, my proficiency with SQL is lacking. What I understood from your explanation: - A filter/exclude that traverses a 1:N relationship(such as foreign key) should target the same row with all of its criteria(kw

Django 1.6RC1 exclude behavior change

2013-11-04 Thread jgastal
I've found what looks like a serious behavior change in the exclude queryset method from Django 1.5.5 to Django 1.6 rc1. It seems that on 1.5.5 exclude when traversing relationships only excluded items if all criteria on the kwargs were matched on the same related item. On 1.6rc1 it excludes it