summaryrefslogtreecommitdiff
path: root/app/figments/views.py
blob: 6521c29f9d7fd7855252373b2efc5fe8d85a6475 (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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
from django.views.generic import ListView, DetailView
from django.contrib.syndication.views import Feed

from .models import Figment, Series


class FigmentListView(ListView):
    model = Figment
    template_name = "archives/figments.html"
    context_object_name = 'object_list'

    def get_queryset(self):
        return Figment.objects.filter(status__exact=1).order_by('-pub_date')


class SeriesListView(ListView):
    model = Series
    template_name = "archives/figments_series.html"
    context_object_name = 'object_list'


class FigmentDetailView(DetailView):
    model = Figment
    template_name = "details/figments.html"


class FigmentDetailViewTXT(FigmentDetailView):
    template_name = "details/entry.txt"


class FigmentDetailViewAMP(FigmentDetailView):
    template_name = "details/entry.amp"


class FigRSSFeedView(Feed):
    title = "luxagraf figments: stories less literally true."
    link = "/figments/"
    description = "Latest postings to luxagraf.net/figments"
    description_template = 'feeds/blog_description.html'

    def items(self):
        return Figment.objects.filter(status__exact=1).order_by('-pub_date')[:10]