we can only have one order_by per facet!
parent
6205417b8c
commit
b659d80855
|
@ -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"
|
||||
|
||||
|
|
Loading…
Reference in New Issue