Port NOMCOM announcement sitemap
- Legacy-Id: 3782
This commit is contained in:
parent
79fe54e8df
commit
99175b583e
|
@ -1,14 +1,18 @@
|
|||
# Copyright The IETF Trust 2007, All Rights Reserved
|
||||
|
||||
from django.conf import settings
|
||||
from django.contrib.sitemaps import Sitemap
|
||||
from ietf.announcements.models import Announcement
|
||||
from ietf.announcements.models import Message
|
||||
|
||||
class NOMCOMAnnouncementsMap(Sitemap):
|
||||
changefreq = "never"
|
||||
def items(self):
|
||||
if settings.USE_DB_REDESIGN_PROXY_CLASSES:
|
||||
return Message.objects.filter(related_groups__acronym__startswith="nomcom").exclude(related_groups__acronym="nomcom").order_by('-time')
|
||||
return Announcement.objects.all().filter(nomcom=True)
|
||||
def location(self, obj):
|
||||
return "/ann/nomcom/%d/" % obj.announcement_id
|
||||
return "/ann/nomcom/%d/" % obj.id
|
||||
def lastmod(self, obj):
|
||||
# could re-parse the time into a datetime object
|
||||
return obj.announced_date
|
||||
return obj.time
|
||||
|
|
Loading…
Reference in a new issue