summaryrefslogtreecommitdiff
path: root/sitemaps.py
diff options
context:
space:
mode:
authorIsmael Carnales <icarnales@gmail.com>2009-10-30 19:36:42 -0200
committerIsmael Carnales <icarnales@gmail.com>2009-11-09 22:24:45 -0200
commitc1a197d29a692b7066ad12026f4bb9e92172f6b4 (patch)
tree7478f1c2a6f90c5d42c04ab5dd6f40c7cc9521d6 /sitemaps.py
parent19f0a3fb57e53977d1f2017033f0714a8cfc8779 (diff)
added sitemaps from archweb_pub
Diffstat (limited to 'sitemaps.py')
-rw-r--r--sitemaps.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/sitemaps.py b/sitemaps.py
new file mode 100644
index 00000000..9e2ef856
--- /dev/null
+++ b/sitemaps.py
@@ -0,0 +1,25 @@
+from django.contrib.sitemaps import Sitemap
+from archweb.main.models import Package, News
+
+class PackagesSitemap(Sitemap):
+ changefreq = "monthly"
+ priority = "0.4"
+
+ def items(self):
+ return Package.objects.all()
+
+ def lastmod(self, obj):
+ return obj.last_update
+
+class NewsSitemap(Sitemap):
+ changefreq = "never"
+ priority = "0.7"
+
+ def items(self):
+ return News.objects.all()
+
+ def lastmod(self, obj):
+ return obj.postdate
+
+# vim: set ts=4 sw=4 et:
+