Commits

tehfink  committed 2196c53

sitemaps class for news plugin. thanks bzed from bitbucket!

  • Participants
  • Parent commits 465492e
  • Branches cms-2.0.2

Comments (0)

Files changed (1)

File cmsplugin_news/sitemaps.py

+from django.contrib.sitemaps import Sitemap
+from cmsplugin_news.models import News
+
+class CMSPluginNewsSitemap(Sitemap):
+    changefreq = "weekly"
+    priority = 0.5
+
+    def items(self):
+        return News.published.all()
+
+    def lastemod(self, news):
+        return news.updated or news.pub_date or news.created