datatracker/ietf/ipr/feeds.py
Henrik Levkowetz aa5e61d958 Updated all urlpatterns to use ietf.utils.urls.url() instead of django's,
in order to autogenerate dotted path url pattern names.  Updated a number
of url reverses to use dotted path, and removed explicit url pattern names
as needed.

Changed some imports to prevent import of ietf.urls before django
initialization was complete.


Changed 3 cases of form classes being curried to functions; django 1.10
didn't accept that.

Started converting old-style middleware classes to new-style middleware
functions (incomplete).

Tweaked a nomcom decorator to preserve function names and attributes, like
a good decorator should.

Replaced the removed django templatetag 'removetags' with our own version
which uses bleach, and does sanitizing in addition to removing explicitly
mentionied html tags.

Rewrote the filename argument handling in a management command which had
broken with the upgrade.
 - Legacy-Id: 12818
2017-02-11 14:43:01 +00:00

41 lines
1.2 KiB
Python

# Copyright The IETF Trust 2007, All Rights Reserved
from django.contrib.syndication.views import Feed
from django.utils.feedgenerator import Atom1Feed
from django.core.urlresolvers import reverse_lazy
from django.utils.safestring import mark_safe
from ietf.ipr.models import IprDisclosureBase
class LatestIprDisclosuresFeed(Feed):
feed_type = Atom1Feed
title = "IPR Disclosures to the IETF"
link = reverse_lazy('ietf.ipr.views.showlist')
description = "Updates on new IPR Disclosures made to the IETF."
language = "en"
feed_url = "/feed/ipr/"
def items(self):
return IprDisclosureBase.objects.filter(state__in=('posted','removed')).order_by('-time')[:30]
def item_title(self, item):
return mark_safe(item.title)
def item_description(self, item):
return unicode(item.title)
def item_pubdate(self, item):
return item.time
def item_author_name(self, item):
if item.by:
return item.by.name
else:
return None
def item_author_email(self, item):
if item.by:
return item.by.email_address()
else:
return None