Port idtracker/sitemaps.py to new schema

- Legacy-Id: 3125
This commit is contained in:
Ole Laursen 2011-05-13 15:08:40 +00:00
parent e12cd7d662
commit f22e864d62
2 changed files with 8 additions and 1 deletions
ietf

View file

@ -1,12 +1,16 @@
# Copyright The IETF Trust 2007, All Rights Reserved
#
from django.contrib.sitemaps import Sitemap
from django.conf import settings
from ietf.idtracker.models import IDInternal, InternetDraft
class IDTrackerMap(Sitemap):
changefreq = "always"
def items(self):
return IDInternal.objects.exclude(draft=999999)
if settings.USE_DB_REDESIGN_PROXY_CLASSES:
return IDInternal.objects.all()
else:
return IDInternal.objects.exclude(draft=999999)
class DraftMap(Sitemap):
changefreq = "always"

View file

@ -36,6 +36,9 @@ sitemaps = {
'nomcom-announcements': NOMCOMAnnouncementsMap,
}
if settings.USE_DB_REDESIGN_PROXY_CLASSES:
del sitemaps['drafts'] # not needed, overlaps sitemaps['idtracker']
urlpatterns = patterns('',
(r'^feed/(?P<url>.*)/$', 'django.contrib.syndication.views.feed',
{ 'feed_dict': feeds}),