* 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
This commit is contained in:
parent
f9b9b51536
commit
d927568b25
26
ietf/ipr/feeds.py
Normal file
26
ietf/ipr/feeds.py
Normal file
|
@ -0,0 +1,26 @@
|
|||
from django.contrib.syndication.feeds import Feed
|
||||
from django.utils.feedgenerator import Atom1Feed
|
||||
from ietf.ipr.models import IprDetail
|
||||
import datetime
|
||||
|
||||
class LatestIprDisclosures(Feed):
|
||||
feed_type = Atom1Feed
|
||||
feed_url = "/feeds/ipr/"
|
||||
title = "IPR Disclosures to the IETF"
|
||||
link = "/ipr/"
|
||||
description = "Updates on new IPR Disclosures made to the IETF."
|
||||
language = "en"
|
||||
|
||||
def items(self):
|
||||
return IprDetail.objects.order_by('-submitted_date')[:5]
|
||||
|
||||
def item_link(self, item):
|
||||
return "/ipr/ipr-%s" % item.ipr_id
|
||||
def item_pubdate(self, item):
|
||||
return item.submitted_date
|
||||
def item_author_name(self, item):
|
||||
return item.get_submitter().name or None
|
||||
def item_author_email(self, item):
|
||||
return item.get_submitter().email or None
|
||||
|
||||
|
|
@ -90,6 +90,23 @@ class IprDetail(models.Model):
|
|||
return "YES"
|
||||
else:
|
||||
return "NO"
|
||||
def get_patent_holder_contact(self):
|
||||
try:
|
||||
return self.contact.filter(contact_type=1)[0]
|
||||
except:
|
||||
return None
|
||||
def get_ietf_contact(self):
|
||||
try:
|
||||
return self.contact.filter(contact_type=2)[0]
|
||||
except:
|
||||
return None
|
||||
def get_submitter(self):
|
||||
try:
|
||||
return self.contact.filter(contact_type=3)[0]
|
||||
except:
|
||||
return None
|
||||
def get_absolute_url(self, item):
|
||||
return "http://merlot.tools.ietf.org:31415/ipr/ipr-%s" % ipr_id
|
||||
class Meta:
|
||||
db_table = 'ipr_detail'
|
||||
class Admin:
|
||||
|
|
|
@ -101,6 +101,9 @@ INTERNAL_IPS = (
|
|||
'135.207.33.119',
|
||||
# fenestro
|
||||
'67.188.114.134',
|
||||
# shiraz and marsanne
|
||||
'81.232.110.214',
|
||||
'2001:16d8:ff54::1',
|
||||
)
|
||||
|
||||
# Put SECRET_KEY in here, or any other sensitive or site-specific
|
||||
|
|
|
@ -2,11 +2,13 @@ from django.conf.urls.defaults import *
|
|||
|
||||
from ietf.iesg.feeds import IESGMinutes
|
||||
from ietf.idtracker.feeds import DocumentComments
|
||||
from ietf.ipr.feeds import LatestIprDisclosures
|
||||
import ietf.views
|
||||
|
||||
feeds = {
|
||||
'iesg_minutes': IESGMinutes,
|
||||
'comments': DocumentComments,
|
||||
'ipr': LatestIprDisclosures,
|
||||
}
|
||||
|
||||
urlpatterns = patterns('',
|
||||
|
|
Loading…
Reference in a new issue