Something like this: Query = Comments.objects.all().sort_by("submit_date")[:5]
-- Sent from my Palm Pre Viktor Semykin wrote: Hi everyone. I'm trying to create comment overview page. I want to select all content entries that were recently commented. The problem is that I don't know how to do that. In SQL I would run something like select distinct object_pk from (select * from django_comments order by submit_date desc) as all_comments limit 5; (PostgreSQL) but is there a way to do that in terms of django QuerySet without raw SQL? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@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 -~----------~----~----~----~------~----~------~--~---