we can only have one order_by per facet!

pull/1/head
eric 2012-03-12 16:40:21 -04:00
parent 6205417b8c
commit b659d80855
1 changed files with 3 additions and 3 deletions

View File

@ -228,7 +228,7 @@ class WorkListView(ListView):
if (facet == 'popular'):
return models.Work.objects.order_by('-num_wishes', 'id')
elif (facet == 'recommended'):
return models.Work.objects.filter(wishlists__user=recommended_user)
return models.Work.objects.filter(wishlists__user=recommended_user).order_by('-num_wishes')
elif (facet == 'new'):
return models.Work.objects.filter(num_wishes__gt=0).order_by('-created', '-num_wishes' ,'id')
else:
@ -240,8 +240,8 @@ class WorkListView(ListView):
context['ungluers'] = userlists.work_list_users(qs,5)
context['facet'] =self.kwargs['facet']
context['works_unglued'] = qs.filter(editions__ebooks__isnull=False).distinct()
context['works_active'] = qs.exclude(editions__ebooks__isnull=False).filter(Q(campaigns__status='ACTIVE') | Q(campaigns__status='SUCCESSFUL')).distinct().order_by('-campaigns__status', 'campaigns__deadline')
context['works_wished'] = qs.exclude(editions__ebooks__isnull=False).exclude(campaigns__status='ACTIVE').exclude(campaigns__status='SUCCESSFUL').distinct().order_by('-num_wishes')
context['works_active'] = qs.exclude(editions__ebooks__isnull=False).filter(Q(campaigns__status='ACTIVE') | Q(campaigns__status='SUCCESSFUL')).distinct()
context['works_wished'] = qs.exclude(editions__ebooks__isnull=False).exclude(campaigns__status='ACTIVE').exclude(campaigns__status='SUCCESSFUL').distinct()
context['activetab'] = "#3"