Skip to content

Commit d927568

Browse files
committed
* Added henrik's IPs to local sites in settings.py
* Added accessor functions for contacts to ipr/models.py * Added an IPR feed - Legacy-Id: 102
1 parent f9b9b51 commit d927568

4 files changed

Lines changed: 48 additions & 0 deletions

File tree

ietf/ipr/feeds.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
from django.contrib.syndication.feeds import Feed
2+
from django.utils.feedgenerator import Atom1Feed
3+
from ietf.ipr.models import IprDetail
4+
import datetime
5+
6+
class LatestIprDisclosures(Feed):
7+
feed_type = Atom1Feed
8+
feed_url = "/feeds/ipr/"
9+
title = "IPR Disclosures to the IETF"
10+
link = "/ipr/"
11+
description = "Updates on new IPR Disclosures made to the IETF."
12+
language = "en"
13+
14+
def items(self):
15+
return IprDetail.objects.order_by('-submitted_date')[:5]
16+
17+
def item_link(self, item):
18+
return "/ipr/ipr-%s" % item.ipr_id
19+
def item_pubdate(self, item):
20+
return item.submitted_date
21+
def item_author_name(self, item):
22+
return item.get_submitter().name or None
23+
def item_author_email(self, item):
24+
return item.get_submitter().email or None
25+
26+

ietf/ipr/models.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,23 @@ def selectownedtext(self):
9090
return "YES"
9191
else:
9292
return "NO"
93+
def get_patent_holder_contact(self):
94+
try:
95+
return self.contact.filter(contact_type=1)[0]
96+
except:
97+
return None
98+
def get_ietf_contact(self):
99+
try:
100+
return self.contact.filter(contact_type=2)[0]
101+
except:
102+
return None
103+
def get_submitter(self):
104+
try:
105+
return self.contact.filter(contact_type=3)[0]
106+
except:
107+
return None
108+
def get_absolute_url(self, item):
109+
return "http://merlot.tools.ietf.org:31415/ipr/ipr-%s" % ipr_id
93110
class Meta:
94111
db_table = 'ipr_detail'
95112
class Admin:

ietf/settings.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,9 @@
101101
'135.207.33.119',
102102
# fenestro
103103
'67.188.114.134',
104+
# shiraz and marsanne
105+
'81.232.110.214',
106+
'2001:16d8:ff54::1',
104107
)
105108

106109
# Put SECRET_KEY in here, or any other sensitive or site-specific

ietf/urls.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@
22

33
from ietf.iesg.feeds import IESGMinutes
44
from ietf.idtracker.feeds import DocumentComments
5+
from ietf.ipr.feeds import LatestIprDisclosures
56
import ietf.views
67

78
feeds = {
89
'iesg_minutes': IESGMinutes,
910
'comments': DocumentComments,
11+
'ipr': LatestIprDisclosures,
1012
}
1113

1214
urlpatterns = patterns('',

0 commit comments

Comments
 (0)