fix extra query for user_vote

This commit is contained in:
James Turk 2009-08-19 12:57:16 -04:00
parent cda56dba20
commit ef03c3fa74

View File

@ -39,7 +39,7 @@ class Subsite(models.Model):
class IdeaManager(models.Manager):
def with_user_vote(self, user):
return self.extra(select={'user_vote':'SELECT value FROM brainstorm_vote WHERE idea_id=ideas_idea.id AND user_id=%s'}, select_params=[user.id])
return self.extra(select={'user_vote':'SELECT value FROM brainstorm_vote WHERE idea_id=brainstorm_idea.id AND user_id=%s'}, select_params=[user.id])
class Idea(models.Model):