1👍
✅
if I am getting right what would you like to achieve, try this:
objs = Bar.objects.filter(thing__pk__in=Foo.objects.all().order_by('-frequency').values_list('pk', flat=True)[:10])
👤sebb
Source:stackexchange.com