From 77cb564ab121f82e0aecfadc34225cae08a2b28a Mon Sep 17 00:00:00 2001 From: luxagraf Date: Wed, 16 May 2018 20:26:04 -0400 Subject: changed sightings to emphasize the dialogue aspect --- app/sightings/views.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'app/sightings') diff --git a/app/sightings/views.py b/app/sightings/views.py index e97638f..cb821c8 100644 --- a/app/sightings/views.py +++ b/app/sightings/views.py @@ -4,11 +4,13 @@ from utils.views import PaginatedListView from .models import AP, Sighting from dal import autocomplete + class SightingListView(PaginatedListView): template_name = 'archives/sightings.html' def get_queryset(self): - return Sighting.objects.all() + qs_ids = Sighting.objects.order_by('ap__id', '-pub_date').distinct('ap').values_list('id', flat=True) + return Sighting.objects.filter(id__in=qs_ids).order_by('-pub_date') class SightingListUserView(PaginatedListView): -- cgit v1.2.3-70-g09d2