acangiani / django-tagging

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

TaggedItem manager method "get_by_model" gives error when given a QuerySet as first argument and a tag different from the first as second argument #99

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago

Hi,

say I have a QuerySet1 generated as follow:
qs1 = TaggedItem.objects.get_by_model(Offer, 'tv')
and I want to generate a qs2 giving the qs1 as first parameter:
qs2 = TaggedItem.objects.get_by_model(qs1, ['tv', 'samsung'])
then things work as expected.

If, instead, I try to generate qs2 in either of the following two ways:
qs2 = TaggedItem.objects.get_by_model(qs1, ['samsung'])
that is with only the second of the two tags in a list
qs2 = TaggedItem.objects.get_by_model(qs1, 'samsung')
that is with only the second of the two tags as string,
then I get the error "OperationalError: ambiguous column name:
tagging_taggeditem.object_id".

Here I pasted the whole traceback.
http://dpaste.com/36350/

Thanks
Francesco

Original issue reported on code.google.com by fd.calab...@gmail.com on 21 Feb 2008 at 10:52

GoogleCodeExporter commented 9 years ago
Forgot to say that similar problem was showing up when ending the two queryset 
(qs1 &
qs2) with qs2 generated as:
TaggedItem.objects.get_by_model(Offer, 'samsung')

Here is the traceback:
http://dpaste.com/36177/

Of course "Offer" is a model.

Thanks again
Francesco

Original comment by fd.calab...@gmail.com on 21 Feb 2008 at 10:59