> >>> 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 [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en.