Re: django-voting : How to get objects with number of votes.

2011-05-06 Thread AJ
I am not aware what 'relations' can do or if there was anything like 'relations' let alone 'GenericRelations' :) What does the Sum('vote') done? -- 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

Re: django-voting : How to get objects with number of votes.

2011-05-06 Thread Jason Culverhouse
On May 6, 2011, at 8:35 AM, Shawn Milochik wrote: > Sorry, I was going off of your pasted code. > > Sounds like this could be a case for annotate. > http://docs.djangoproject.com/en/1.3/ref/models/querysets/#annotate > > I recommend reading this whole page, along with the two prerequisite pages

Re: django-voting : How to get objects with number of votes.

2011-05-06 Thread Shawn Milochik
Sorry, I was going off of your pasted code. Sounds like this could be a case for annotate. http://docs.djangoproject.com/en/1.3/ref/models/querysets/#annotate I recommend reading this whole page, along with the two prerequisite pages called for at the top. It'll help a lot. -- You received th

Re: django-voting : How to get objects with number of votes.

2011-05-06 Thread AJ
Appreciate your response, Shawn. I am a newbie and struggling. Yea, but that is 'latest'. I need ascending descending order by score/votes. Can't seem to figure that one out. That would go in the else part. By default in my app, I want the comments to be sorted by vote/score. else:#This is

Re: django-voting : How to get objects with number of votes.

2011-05-06 Thread Shawn Milochik
You could probably sort ascending, take a subset, then reverse the search. Something like this: | .order_by('created_datetime', 'modified_datetime')[:100].reverse()| -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, s