Guest User

Untitled

a guest
Jan 18th, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.16 KB | None | 0 0
  1. A.x = 1 (newest)
  2. A.x = 1
  3. A.x = 1 (oldest)
  4. A.x = 2
  5.  
  6. Queryset.order_by('-date').distinct('field')
  7.  
  8. latest_object = Model.objects.latest("date/datetime fieldname")
Add Comment
Please, Sign In to add comment