diff options
Diffstat (limited to 'app/sightings')
-rw-r--r-- | app/sightings/views.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/app/sightings/views.py b/app/sightings/views.py index 3170b77..0c1f296 100644 --- a/app/sightings/views.py +++ b/app/sightings/views.py @@ -1,16 +1,17 @@ from django.views.generic.detail import DetailView from django.views.generic import ListView from django.contrib.auth.models import User -from utils.views import PaginatedListView +from utils.views import PaginatedListView,LuxDetailView from .models import AP, Sighting, FieldNote class SightingListView(PaginatedListView): + model = Sighting def get_queryset(self): 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').prefetch_related('ap') - + class LifeListView(ListView): template_name = 'archives/life-list.html' @@ -34,7 +35,7 @@ class SightingListUserView(PaginatedListView): return context -class SightingDetailView(DetailView): +class SightingDetailView(LuxDetailView): model = AP def get_context_data(self, **kwargs): |