Say I have a model

class MyModel(models.Model)
    name = models.CharField(max_length=20)
    age = models.IntergerField()

How can I find the maximum based on the 'Age' field number and retrieve 
that whole object? I understand aggregates allows me to find and retrieve 
the maximum number when given a field to run on, but I only get the maximum 
number ONLY and not the other items in the row.

Does django have something that allows to find the maximum (or minimum) 
value of a database field, then retrieve whole row in the query?

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@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.

Reply via email to