Commits

Luke Plant  committed a19201c

Made use of order_by_count option for speaker filter for sermons page

  • Participants
  • Parent commits 12d58d5

Comments (0)

Files changed (1)

File sermons/views.py

 from django.conf import settings
 from django.shortcuts import render
-from django_easyfilters import FilterSet
+from django_easyfilters import FilterSet, FilterOptions
 
 from sermons.models import Sermon
 
 class SermonFilterSet(FilterSet):
-    fields = ['speaker']
+    fields = [
+        ('speaker', FilterOptions(order_by_count=True))
+        ]
 
 def index(request):
     sermons = Sermon.objects.filter(published=True)