Hi all,
I obtain a list of tag ids by:
tag_ids = TaggedItem.objects.all().order_by('-added__max').annotate(Max
('added'))[:10]
and try to use it in the following query to obtain tag objects:
Tag.objects.filter(id__in=tag_ids)
But i get "invalid reference to FROM-clause" error:
Caught an exception while rendering: invalid reference to FROM-clause
entry for table "tagging_taggeditem"
LINE 1: ...RE "tagging_tag"."id" IN (SELECT U0."tag_id", MAX
("tagging_t...
^
HINT: Perhaps you meant to reference the table alias "u0".
If I force the first query to be evaluated, using the step syntax (ie
[:10:1] instead of [:10]), then everthing works fine.
Seems like a bug?
ps: I am using a recent svn version.
Thanks...
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---