turns out pubdate messes up distinct, MySQL doesn't support DISTINCT ON
parent
760cbe70cf
commit
9e65349336
|
@ -25,7 +25,6 @@
|
|||
<ul class="menu level3">
|
||||
<li class="first"><a href="{% url bypub_list 'popular' pubname %}"><span>Most popular</span></a></li>
|
||||
<li><a href="{% url bypub_list pubname %}"><span>By Title</span></a></li>
|
||||
<li><a href="{% url bypub_list 'pubdate' pubname %}"><span>By Date Published</span></a></li>
|
||||
</ul>
|
||||
</li>
|
||||
{% endif %}
|
||||
|
|
|
@ -529,7 +529,7 @@ class ByPubListView(WorkListView):
|
|||
if (facet == 'popular'):
|
||||
return objects.order_by('-num_wishes', 'id')
|
||||
elif (facet == 'pubdate'):
|
||||
return objects.order_by('-editions__publication_date')
|
||||
return objects.order_by('-editions__publication_date') # turns out this messes up distinct, and MySQL doesn't support DISTINCT ON
|
||||
elif (facet == 'new'):
|
||||
return objects.filter(num_wishes__gt=0).order_by('-created', '-num_wishes' ,'id')
|
||||
else:
|
||||
|
|
Loading…
Reference in New Issue