I\'m struggling getting my head around the Django\'s ORM. What I want to do is get a list of distinct values within a field on my table .... the equivalent of one of the fol
By example:
# select distinct code from Platform where id in ( select platform__id from Build where product=p)
pl_ids = Build.objects.values('platform__id').filter(product=p)
platforms = Platform.objects.values_list('code', flat=True).filter(id__in=pl_ids).distinct('code')
platforms = list(platforms) if platforms else []