Re: union with an EmptyQuerySet results in an EmptyQuerySet

2008-05-23 Thread omat
I figured it out: unique query is referring to distinct() and to combine two QuerySets, they should both be distinct() or non-distinct. On May 23, 12:17 pm, omat <[EMAIL PROTECTED]> wrote: > I was able to track down the problem a little further and I saw that > > Tag.objects.get_for_model(Not

Re: union with an EmptyQuerySet results in an EmptyQuerySet

2008-05-23 Thread omat
I was able to track down the problem a little further and I saw that Tag.objects.get_for_model(Note, 'foo') | Note.objects.filter(tag='bar') results in a: "Cannot combine a unique query with a non-unique query" exception. Does anybody have any idea what that means? What is a unique query?

Re: union with an EmptyQuerySet results in an EmptyQuerySet

2008-05-22 Thread omat
An other case where I get empty result sets unexpectedly is when I want to join 2 querysets, one holding the objects that the current user entered and the other holds the objects marked as favorite by the current user. I have a manager for Favorite objects that takes the model and the user and re

union with an EmptyQuerySet results in an EmptyQuerySet

2008-05-22 Thread omat
Hi, The "bitwise or" ('|') works fine when taking the union of query sets such as: Note.objects.filter(tag='foo') | Note.objects.filter(tag='bar') But the result of following is an EmptyQuerySet object: Note.objects.filter(tag='foo') | Note.objects.none() Shouldn't it be equivalent to Note.obje