Django equivalent for latest entry for each user
- by paul-ogrady
Hi,
I'm surprised this question hasn't come up. Couldn't find much on the web.
Using Entry.objects.latest('created_at') I can recover the latest entry for all Entry objects, but say if I want the latest entry for each user? This is something similar to an SQL latest record query. But how do I achieve this using the ORM? Here is my approach I'm…