summaryrefslogtreecommitdiff
path: root/app/sightings/views.py
diff options
context:
space:
mode:
Diffstat (limited to 'app/sightings/views.py')
-rw-r--r--app/sightings/views.py26
1 files changed, 24 insertions, 2 deletions
diff --git a/app/sightings/views.py b/app/sightings/views.py
index 1c42fd4..24c341d 100644
--- a/app/sightings/views.py
+++ b/app/sightings/views.py
@@ -12,16 +12,38 @@ class SightingListView(PaginatedListView):
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')
+ def get_context_data(self, **kwargs):
+ context = super(SightingListView, self).get_context_data(**kwargs)
+ context['breadcrumbs'] = ['dialogues',]
+ return context
+
class LifeListView(ListView):
- template_name = 'archives/life-list.html'
+ template_name = 'sightings/life-list.html'
def get_queryset(self):
return Sighting.objects.filter(ap__apclass__kind=1).order_by('ap__id').distinct('ap')
+ def get_context_data(self, **kwargs):
+ context = super(LifeListView, self).get_context_data(**kwargs)
+ context['breadcrumbs'] = ['dialogues',]
+ return context
+
+
+class NotLifeListView(ListView):
+ template_name = 'sightings/not_life_list.html'
+
+ def get_queryset(self):
+ return AP.objects.filter(apclass__kind=1).filter(have_seen=False)
+
+ def get_context_data(self, **kwargs):
+ context = super(NotLifeListView, self).get_context_data(**kwargs)
+ context['breadcrumbs'] = ['dialogues',]
+ return context
+
class YearListView(ListView):
- template_name = 'archives/life-list.html'
+ template_name = 'sightings/life-list.html'
def get_queryset(self):
return Sighting.objects.filter(ap__apclass__kind=1).filter(pub_date__year=self.kwargs['year']).order_by('ap__id').distinct('ap')