H30
H30

Reputation: 124

Can I do a django get latest where ==

I already have a function to get latest by date foo.objects.latest('date_added').itemName I want to know if it is possible some something similar but with an added where like if I have type a, b or c I want to get the latest by date_added where it is type c for instance.

Upvotes: 0

Views: 48

Answers (1)

Alex Hall
Alex Hall

Reputation: 36033

foo.objects.filter(type='c').latest('date_added')

Upvotes: 1

Related Questions