diff options
author | luxagraf <sng@luxagraf.net> | 2011-02-02 17:56:20 -0600 |
---|---|---|
committer | luxagraf <sng@luxagraf.net> | 2011-02-02 17:56:20 -0600 |
commit | 8414a1ee0848fe82706cda255d5ddc7dd1d2702c (patch) | |
tree | c51907d30784f17c46f4791a48d3c2344106d913 | |
parent | 0d59098a21ead5febb76bcaaddf49567bd2f9f20 (diff) |
fixed a bug in the sitemap
-rw-r--r-- | apps/projects/models/base.py | 13 | ||||
-rw-r--r-- | base_urls.py | 5 |
2 files changed, 15 insertions, 3 deletions
diff --git a/apps/projects/models/base.py b/apps/projects/models/base.py index 96ccd59..df279ad 100644 --- a/apps/projects/models/base.py +++ b/apps/projects/models/base.py @@ -60,4 +60,15 @@ class Project(models.Model): return self.get_previous_by_pub_date(status__exact=1) def get_next_published(self): - return self.get_next_by_pub_date(status__exact=1)
\ No newline at end of file + return self.get_next_by_pub_date(status__exact=1) + + +class ProjectSitemap(Sitemap): + changefreq = "never" + priority = 1.0 + + def items(self): + return Project.objects.filter(status=1) + + def lastmod(self, obj): + return obj.pub_date diff --git a/base_urls.py b/base_urls.py index 2b9f4e8..4f638ad 100644 --- a/base_urls.py +++ b/base_urls.py @@ -9,14 +9,15 @@ from blog.models import BlogSitemap,LatestFull from locations.models import WritingbyLocationSitemap from links.models import LatestLinks from photos.models import PhotoGallerySitemap +from projects.models.base import ProjectSitemap admin.autodiscover() sitemaps = { 'blog': BlogSitemap, - 'flatpages': FlatPageSitemap, - 'photos': PhotoGallerySitemap + 'photos': PhotoGallerySitemap, + 'projects': ProjectSitemap } feeds = { 'writing': LatestFull, |