> >>> from django.db.models import Max
> >>> Client.objects.aggregate(maxid=Max('id'))
>
> {'maxid': 2L}
>
> And you'll get a dictionary with the value you want as a result.
>
> [1]:http://docs.djangoproject.com/en/1.1/topics/db/aggregation/

Thanks for link, problem solve.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to