Re: How to display the recent comments
Thanks Alex, I didn't think about it that way, so far I've just used the template tags for the comment system but I'll start using it like that. On Apr 19, 12:42 am, Alex Gaynor wrote: > On Sat, Apr 18, 2009 at 6:40 PM, Bastien wrote: > > > Hi, > > > I try to find the way to display the recent comments for a given site, > > regardless of app / model but the doc doesn't show much, anybody has > > it already? thanks > > Comment is just a model so you can interact and preform queries with it the > same way you would with any model: > > from django,contrib.comments.models import Comment > Comment.objects.all().filter(site=1).order_by('-submit_date')[:10] > > Would give you the 10 most recent comments on site '1'. > > Alex > > -- > "I disapprove of what you say, but I will defend to the death your right to > say it." --Voltaire > "The people's good is the highest law."--Cicero --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: How to display the recent comments
please define more what you means with comments On Sun, Apr 19, 2009 at 6:10 PM, Bastien wrote: > > Hi, > > I try to find the way to display the recent comments for a given site, > regardless of app / model but the doc doesn't show much, anybody has > it already? thanks > > > --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: How to display the recent comments
On Sat, Apr 18, 2009 at 6:40 PM, Bastien wrote: > > Hi, > > I try to find the way to display the recent comments for a given site, > regardless of app / model but the doc doesn't show much, anybody has > it already? thanks > > > Comment is just a model so you can interact and preform queries with it the same way you would with any model: from django,contrib.comments.models import Comment Comment.objects.all().filter(site=1).order_by('-submit_date')[:10] Would give you the 10 most recent comments on site '1'. Alex -- "I disapprove of what you say, but I will defend to the death your right to say it." --Voltaire "The people's good is the highest law."--Cicero --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
How to display the recent comments
Hi, I try to find the way to display the recent comments for a given site, regardless of app / model but the doc doesn't show much, anybody has it already? thanks --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---