forked from adamlaska/datatracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfeeds.py
More file actions
43 lines (33 loc) · 1.21 KB
/
feeds.py
File metadata and controls
43 lines (33 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# Copyright The IETF Trust 2007-2020, All Rights Reserved
# -*- coding: utf-8 -*-
from django.contrib.syndication.views import Feed
from django.utils.feedgenerator import Atom1Feed
from django.urls import reverse_lazy
from django.utils.safestring import mark_safe
from django.utils.encoding import force_text
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 force_text(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