Commit 0a653089 authored by Daniel W Bond's avatar Daniel W Bond

fixed queryset

parent ddb55224
......@@ -27,7 +27,7 @@ class DetailStudent(LoginRequiredMixin, DetailView):
total_proceeds = Bid.objects.filter(listing__poster__user=self.get_object()).filter(listing__exchanged=True).aggregate(Sum('price'))['price__sum']
student_ratings = Rating.objects.filter(listing__poster__user=self.get_object())
student_ratings = Rating.objects.filter(listing__poster=self.get_object())
if student_ratings:
student_stars = [int(rating.stars) for rating in student_ratings]
print student_stars
......@@ -87,7 +87,7 @@ class StudentRatings(LoginRequiredMixin, DetailView):
def get_context_data(self, **kwargs):
context = super(StudentRatings, self).get_context_data(**kwargs)
student_ratings = Rating.objects.filter(listing__poster__user=self.get_object())
student_ratings = Rating.objects.filter(listing__poster=self.get_object())
# copied code!
if student_ratings:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment