rohitjain-rj / django-tagging

Automatically exported from code.google.com/p/django-tagging
Other
0 stars 0 forks source link

get_intersection_by_model returns same results as get_union_by_model #157

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I hope that this is not just a misunderstanding, but the documentation seems to 
indicate that get_intersection_by_model(Model, tags) retrieves all the 
instances of Model that have *all* the tags 
in tags.  However, here's the code that I ran in the Django shell

>>> articles = TaggedItem.objects.get_intersection_by_model(Article, 
'nonexistent,grapes')
>>> [a.tags for a in articles]
[u'chairman meow, awesome, grapes', u'grapes, faust, harvard, drinking']

It's clear that neither of the articles returned have the tag 'nonexistent'.

Original issue reported on code.google.com by andy...@gmail.com on 31 Aug 2008 at 6:40

GoogleCodeExporter commented 9 years ago
I can "confirm" this issue: nonexistent tags are simply ignored when used in
TaggedItem.objects.get_intersection_by_model. A non-existent tag should return 
an
empty QuerySet.

Original comment by benoit%n...@gtempaccount.com on 30 Oct 2008 at 7:19