I try to get a list of distinct foreign keys and I wrote this:
my_ids = Entity.objects.values(\'foreign_key\').distinct()
But I get just a
Perhaps you might want to go with this:
Entity.objects.order_by().values_list('foreign_key', flat=True).distinct()