from django.contrib.sitemaps import Sitemap
from .models import Article


class ArticleSitemap(Sitemap):
    protocol = 'http'
    priority = '0.7'
    changefreq = 'daily'
    
    
    def items(self):
        return Article.objects.all()
    
    def lastmod(self, obj):
        return obj.updated