summaryrefslogtreecommitdiff
path: root/app/sightings
diff options
context:
space:
mode:
authorluxagraf <sng@luxagraf.net>2018-05-16 20:26:04 -0400
committerluxagraf <sng@luxagraf.net>2018-05-16 20:26:04 -0400
commit77cb564ab121f82e0aecfadc34225cae08a2b28a (patch)
treed8f7c48a6f9da3b7528711436f35ff4cc28809c2 /app/sightings
parentcf3fca6e6ccfafb44cf3d15f1d8f05d5a63c0faf (diff)
changed sightings to emphasize the dialogue aspect
Diffstat (limited to 'app/sightings')
-rw-r--r--app/sightings/views.py4
1 files changed, 3 insertions, 1 deletions
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):