Use a combination of order_by('-age') and first() on your query set.
MyModel.objects.order_by('-age').first()
https://docs.djangoproject.com/en/1.8/ref/models/querysets/#order-by
Obviously that only pulls the "first" object even if multiple objects have that same age, so you may need additional filter() and sorting criteria.
-James
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/5fc15560-93f6-4ba2-a30f-287f1fe76713%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.