ORM 중복 제거 – distinct
https://django-orm-cookbook-ko.readthedocs.io/en/latest/duplicate.html
>>> duplicates = User.objects.values(
'first_name'
).annotate(name_count=Count('first_name')).filter(name_count__gt=1)
>>> duplicates
<QuerySet [{'first_name': 'John', 'name_count': 3}]>
여기 링크 글이 좋음 – https://unocoings.tistory.com/12