summaryrefslogtreecommitdiffstats
path: root/askbot/sitemap.py
blob: c50c64dcd48978041ca1d99c1f71ac3ca63638bb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
from django.contrib.sitemaps import Sitemap
from askbot.models import Post

class QuestionsSitemap(Sitemap):
    changefreq = 'daily'
    priority = 0.5
    def items(self):
        return Post.objects.get_questions().exclude(deleted=True)

    def lastmod(self, obj):
        return obj.thread.last_activity_at

    def location(self, obj):
        return obj.get_absolute_url()