On 6/28/06, Mikko Nylén <[EMAIL PROTECTED]
> wrote:
Interesting... this could be interpreted as a bug in exclude(). It might be worth checking to see if this has been identified before, and if not, raising this as a bug. Sounds like it could be a problem with a join that should be OUTER, but is LEFT INNER (or some such).
exclude() would have been my suggestion. You could try hand writing the SQL, or using where/tables clauses in a filter to build a search that does what you want; or, depending on how large you are expecting your result set to be, actually do the subtraction you mention (all - filter).
Russ Magee %-)
I've tried this:
Color.objects.exclude(similar_colors__the_color__startswith="..."), and it
almost works. However, the problem is, it doesn't give the Colors which
don't have any Colors in similar_colors. I need to get these as well.
Interesting... this could be interpreted as a bug in exclude(). It might be worth checking to see if this has been identified before, and if not, raising this as a bug. Sounds like it could be a problem with a join that should be OUTER, but is LEFT INNER (or some such).
In other words, what I want is (if this syntax would be possible):
Color.objects.all() -
Color.objects.filter(similar_colors__the_color__startswith="..."), as the
filter() gives all those objects I don't want to get included.
exclude() would have been my suggestion. You could try hand writing the SQL, or using where/tables clauses in a filter to build a search that does what you want; or, depending on how large you are expecting your result set to be, actually do the subtraction you mention (all - filter).
Russ Magee %-)
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---