This PostgreSQL query solves my problem, but I'm not sure how to put it in Django ORM.
SELECT DISTINCT ON (to_email) * FROM (SELECT * FROM invitation_invitation ORDER BY date_invited DESC) AS sub
From a list of items, I want all distinct rows for "to_email" column, and where to_email is duplicate, it should select the latest ( date_invited )