summaryrefslogtreecommitdiff
path: root/app/posts/views/__init__.py
blob: 5fd984ca3d45f611441d6b24508c65c86b8d00aa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
from django.contrib.syndication.views import Feed

from ..models import Post

class PostRSSFeedView(Feed):
    title = "Luxagraf: Topographical Writings"
    link = "https://luxagraf.net/"
    description = "Latest postings to luxagraf.net"
    description_template = 'feeds/blog_description.html'

    def items(self):
        return Post.objects.filter(status__exact=1).order_by('-pub_date')[:10]
    
    def item_pubdate(self, item):
        """
        Takes an item, as returned by items(), and returns the item's
        pubdate.
        """
        return item.pub_date