For the reference of anyone who comes across this in the future, you have to fetch the related model IDs as a list, like so:
Entry.objects.filter(category="some category").values_list('id', flat=True) On May 16, 7:24 pm, ringemup <ringe...@gmail.com> wrote: > Thanks -- that was exactly the sort of thing I was looking for! Just > couldn't figure out how to do it. > > > > > Comment.objects.filter(content_type=ContentType.objects.get_for_model(Entry), > > object_pk__in=Entry.objects.filter(category="some category")). --~--~---------~--~----~------------~-------~--~----~ 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 django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---