Permalink
Browse files

Fixed query generation in get_top

git-svn-id: https://django-voting.googlecode.com/svn/trunk@46 662f01ad-f42a-0410-a340-718c64ddaef4
  • Loading branch information...
1 parent 29b56c5 commit 19fa7fd1dbcffac5039e24bd4bd5aa1cc4d0bcc8 @insin insin committed May 16, 2007
Showing with 2 additions and 2 deletions.
  1. +2 −2 models.py
View
@@ -83,9 +83,9 @@ def get_top(self, Model, limit=10, reversed=False):
WHERE content_type_id = %%s
GROUP BY object_id""" % backend.quote_name(self.model._meta.db_table)
if reversed:
- query += 'HAVING SUM(vote) < 0 ORDER BY SUM(vote) ASC LIMIT %s'
+ query += ' HAVING SUM(vote) < 0 ORDER BY SUM(vote) ASC LIMIT %s'
else:
- query += 'HAVING SUM(vote) > 0 ORDER BY SUM(vote) DESC LIMIT %s'
+ query += ' HAVING SUM(vote) > 0 ORDER BY SUM(vote) DESC LIMIT %s'
cursor = connection.cursor()
cursor.execute(query, [ctype.id, limit])
results = cursor.fetchall()

0 comments on commit 19fa7fd

Please sign in to comment.