turns out pubdate messes up distinct, MySQL doesn't support DISTINCT ON

pull/1/head
eric 2013-03-06 14:15:07 -05:00
parent 760cbe70cf
commit 9e65349336
2 changed files with 1 additions and 2 deletions

View File

@ -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 %}

View File

@ -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: