Let's say I have this model
class TreeCensus(models.Model):
name = models.CharField() #Oak, elm, ...
identified_at = models.DateTimeField(auto_now_add=True)
I want to get a QS with the last Census of each tree.
I tried naively this
TreeCensus.object.order_by('name').last()
But It obviously returned me the last of all the TreeCensus objects.
So what is the best way (or at least a good one) to do this? For example if there are 2 Oak in the QS I want to get the first one filtered