blob: 5753069ccf74a1b2e03b67fcf0062ee5f95faf56 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
from django.views.generic import ListView
from django.views.generic.detail import DetailView
from django.contrib.syndication.views import Feed
from django.apps import apps
from django.conf import settings
from utils.views import PaginatedListView, LuxDetailView
from ..models import Post, Trip
class TripListView(PaginatedListView):
"""
Return a list of Entries in reverse chronological order
"""
model = Trip
template_name = "posts/trips_list.html"
class TripDetailView(LuxDetailView):
model = Trip
slug_field = "slug"
template_name = "posts/trip_detail.html"
def get_context_data(self, **kwargs):
context = super(TripDetailView, self).get_context_data(**kwargs)
context['posts'] = Post.objects.filter(status__exact=1,trip=self.object)
return context
|