I have a queryset(which is filtered actually) as below
posts = [, , , ,
You can query the Tag object first and filter Post with those ids:
Tag
Post
tags = Tag.objects.filter(field_name='string_or_field') posts = Post.objects.filter(tags__in=tags)