>From what I could understand, you are trying to fetch all the top ratings
for each question in a group, correct?
The problem is that this query:
top_rated_list = Ratings.objects.get(rating = max_rating)
is returning more than one rating instance. "get" queries are supposed to
return a single
My model structure is like this:
class Group(models.Model):
u_id= models.ForeignKey(User)
group_name = models.CharField(max_length=50,unique=True)
def __str__(self): # __unicode__ on Python 2
return self.group_name + " " + self.org_nam
2 matches
Mail list logo