1. Luke Plant
  2. christchurch_django

Commits

Luke Plant  committed a19201c

Made use of order_by_count option for speaker filter for sermons page

  • Participants
  • Parent commits 12d58d5
  • Branches default

Comments (0)

Files changed (1)

File sermons/views.py

View file
  • Ignore whitespace
 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)