items, item_ids = [], []
for item in OrderNotes.objects.filter(shared_note=219):
    if item.shared_note not in item_ids:
        items.append(item)
item_ids.append(item.shared_note)
DISTINCT ON в джанго