diff options
author | luxagraf <sng@luxagraf> | 2021-01-15 16:36:00 -0500 |
---|---|---|
committer | luxagraf <sng@luxagraf> | 2021-01-15 16:36:00 -0500 |
commit | 776712e1288138f546d105ab621523a2c632638a (patch) | |
tree | 8215fb8e6d024f6f1b1b92bf962334ea61753fd0 /app/sightings | |
parent | 47b79fd9d4329e73cef7929ed8f64d9eeb287ae5 (diff) |
proj: updated several views to use utils.LuxDetailView
This allows for a single breadcrumbs template, consolidating code
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): |