diff options
Diffstat (limited to 'app/posts/views')
-rw-r--r-- | app/posts/views/friends_views.py | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/app/posts/views/friends_views.py b/app/posts/views/friends_views.py new file mode 100644 index 0000000..dd4dac2 --- /dev/null +++ b/app/posts/views/friends_views.py @@ -0,0 +1,39 @@ +from django.views.generic import ListView +from django.views.generic.detail import DetailView +from django.views.generic.dates import DateDetailView +from django.urls import reverse +from django.views.generic.dates import YearArchiveView, MonthArchiveView +from django.contrib.syndication.views import Feed +from django.apps import apps +from django.shortcuts import get_object_or_404 +from django.conf import settings +from django.db.models import Q + +from utils.views import PaginatedListView, LuxDetailView + +#from ..models import Entry, HomepageCurrator, Home +from ..models import Post, PostType +from locations.models import LuxCheckIn, Country, Region, Location +from sightings.models import Sighting + + +class FriendsDetailView(LuxDetailView): + model = Post + slug_field = "slug" + template_name = "posts/friends_detail.html" + + +class FriendsListView(PaginatedListView): + """ + Return a list of Newsletter posts in reverse chronological order + """ + model = Post + template_name = "posts/friends_list.html" + queryset = Post.objects.filter(post_type=PostType.FRIENDS,status=1).order_by('-pub_date') + + def get_context_data(self, **kwargs): + context = super(FriendsListView, self).get_context_data(**kwargs) + context['breadcrumbs'] = ['friends of a long year',] + return context + + |