Move proceedings feed to meeting/ and remove traces of shim layer from it
- Legacy-Id: 6818
This commit is contained in:
parent
ad9503f1ed
commit
5ef84cd7df
43
ietf/meeting/feeds.py
Normal file
43
ietf/meeting/feeds.py
Normal file
|
@ -0,0 +1,43 @@
|
||||||
|
import re, os, datetime
|
||||||
|
|
||||||
|
from django.contrib.syndication.feeds import Feed
|
||||||
|
from django.utils.feedgenerator import Atom1Feed
|
||||||
|
from django.conf import settings
|
||||||
|
|
||||||
|
from ietf.doc.models import Document
|
||||||
|
|
||||||
|
class LatestMeetingMaterial(Feed):
|
||||||
|
feed_type = Atom1Feed
|
||||||
|
link = "/meeting/"
|
||||||
|
language = "en"
|
||||||
|
feed_url = "/feed/wg-proceedings/"
|
||||||
|
base_url = "http://www3.ietf.org/proceedings/"
|
||||||
|
|
||||||
|
def items(self):
|
||||||
|
objs = []
|
||||||
|
for doc in Document.objects.filter(type__in=("agenda", "minutes", "slides")).order_by('-time')[:60]:
|
||||||
|
obj = dict(
|
||||||
|
title=doc.type_id,
|
||||||
|
group_acronym=doc.name.split("-")[2],
|
||||||
|
date=doc.time,
|
||||||
|
link=self.base_url + os.path.join(doc.get_file_path(), doc.external_url)[len(settings.AGENDA_PATH):],
|
||||||
|
author=""
|
||||||
|
)
|
||||||
|
objs.append(obj)
|
||||||
|
|
||||||
|
return objs
|
||||||
|
|
||||||
|
def title(self, obj):
|
||||||
|
return "Meeting Materials Activity"
|
||||||
|
|
||||||
|
def item_link(self, item):
|
||||||
|
return item['link']
|
||||||
|
|
||||||
|
def item_pubdate(self, item):
|
||||||
|
return item['date']
|
||||||
|
|
||||||
|
def item_author_name(self, item):
|
||||||
|
return item['author']
|
||||||
|
|
||||||
|
def item_author_email(self, item):
|
||||||
|
return None
|
|
@ -1,90 +0,0 @@
|
||||||
import re, os
|
|
||||||
from django.contrib.syndication.feeds import Feed
|
|
||||||
from django.utils.feedgenerator import Atom1Feed
|
|
||||||
from django.conf import settings
|
|
||||||
from ietf.proceedings.models import WgProceedingsActivities
|
|
||||||
from ietf.proceedings.models import Slide, WgAgenda, Proceeding
|
|
||||||
from datetime import datetime, time
|
|
||||||
|
|
||||||
class LatestWgProceedingsActivity(Feed):
|
|
||||||
feed_type = Atom1Feed
|
|
||||||
link = "/foo"
|
|
||||||
description = "foobar"
|
|
||||||
language = "en"
|
|
||||||
feed_url = "/feed/wg-proceedings/"
|
|
||||||
base_url = "http://www3.ietf.org/proceedings/"
|
|
||||||
|
|
||||||
def items(self):
|
|
||||||
if settings.USE_DB_REDESIGN_PROXY_CLASSES:
|
|
||||||
objs = []
|
|
||||||
from ietf.doc.models import Document
|
|
||||||
for doc in Document.objects.filter(type__in=("agenda", "minutes", "slides")).order_by('-time')[:60]:
|
|
||||||
obj = dict(
|
|
||||||
title=doc.type_id,
|
|
||||||
group_acronym=doc.name.split("-")[2],
|
|
||||||
date=doc.time,
|
|
||||||
link=self.base_url + os.path.join(doc.get_file_path(), doc.external_url)[len(settings.AGENDA_PATH):],
|
|
||||||
author=""
|
|
||||||
)
|
|
||||||
objs.append(obj)
|
|
||||||
|
|
||||||
return objs
|
|
||||||
|
|
||||||
objs = []
|
|
||||||
for act in WgProceedingsActivities.objects.order_by('-act_date')[:60]:
|
|
||||||
obj = {}
|
|
||||||
|
|
||||||
m = re.match("^slide, '(.*)', was uploaded$", act.activity)
|
|
||||||
if m:
|
|
||||||
obj['title'] = m.group(1)
|
|
||||||
obj['title'] = re.sub("[^ -~]+", "", obj['title'])
|
|
||||||
slides = Slide.objects.filter(meeting=act.meeting).filter(slide_name=m.group(1)).filter(group_acronym_id=act.group_acronym_id)
|
|
||||||
if len(slides) == 1:
|
|
||||||
obj['link'] = self.base_url + slides[0].file_loc()
|
|
||||||
|
|
||||||
m = re.match("^agenda was uploaded$", act.activity)
|
|
||||||
if m:
|
|
||||||
obj['title'] = "agenda";
|
|
||||||
agendas = WgAgenda.objects.filter(meeting=act.meeting).filter(group_acronym_id=act.group_acronym_id)
|
|
||||||
if len(agendas) == 1:
|
|
||||||
dir = Proceeding.objects.get(meeting_num=act.meeting).dir_name
|
|
||||||
obj['link'] = self.base_url + dir + "/agenda/" + agendas[0].filename
|
|
||||||
|
|
||||||
if len(obj) > 0:
|
|
||||||
try:
|
|
||||||
act.irtf = False
|
|
||||||
obj['group_acronym'] = act.acronym()
|
|
||||||
except:
|
|
||||||
act.irtf = True
|
|
||||||
try:
|
|
||||||
obj['group_acronym'] = act.acronym()
|
|
||||||
except:
|
|
||||||
obj['group_acronym'] = "?"
|
|
||||||
obj['date'] = datetime.combine(act.act_date, time(int(act.act_time[0:2]), int(act.act_time[3:5]), int(act.act_time[6:8])))
|
|
||||||
obj['author'] = str(act.act_by)
|
|
||||||
objs.append(obj)
|
|
||||||
|
|
||||||
return objs
|
|
||||||
|
|
||||||
def get_object(self, bits):
|
|
||||||
obj = {}
|
|
||||||
obj['title'] = "This is the title";
|
|
||||||
return obj
|
|
||||||
|
|
||||||
def title(self, obj):
|
|
||||||
return "Meeting Materials Activity"
|
|
||||||
|
|
||||||
def item_link(self, item):
|
|
||||||
if 'link' in item:
|
|
||||||
return item['link']
|
|
||||||
else:
|
|
||||||
return ""
|
|
||||||
|
|
||||||
def item_pubdate(self, item):
|
|
||||||
return item['date']
|
|
||||||
|
|
||||||
def item_author_name(self, item):
|
|
||||||
return item['author']
|
|
||||||
|
|
||||||
def item_author_email(self, item):
|
|
||||||
return None;
|
|
|
@ -7,7 +7,7 @@ from django.contrib import admin
|
||||||
from ietf.iesg.feeds import IESGAgenda
|
from ietf.iesg.feeds import IESGAgenda
|
||||||
from ietf.doc.feeds import DocumentChanges, InLastCall
|
from ietf.doc.feeds import DocumentChanges, InLastCall
|
||||||
from ietf.ipr.feeds import LatestIprDisclosures
|
from ietf.ipr.feeds import LatestIprDisclosures
|
||||||
from ietf.proceedings.feeds import LatestWgProceedingsActivity
|
from ietf.meeting.feeds import LatestMeetingMaterial
|
||||||
from ietf.liaisons.feeds import Liaisons
|
from ietf.liaisons.feeds import Liaisons
|
||||||
from ietf.wgcharter.feeds import GroupChanges
|
from ietf.wgcharter.feeds import GroupChanges
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ feeds = {
|
||||||
'group-changes': GroupChanges,
|
'group-changes': GroupChanges,
|
||||||
'ipr': LatestIprDisclosures,
|
'ipr': LatestIprDisclosures,
|
||||||
'liaison': Liaisons,
|
'liaison': Liaisons,
|
||||||
'wg-proceedings' : LatestWgProceedingsActivity
|
'wg-proceedings' : LatestMeetingMaterial,
|
||||||
}
|
}
|
||||||
|
|
||||||
sitemaps = {
|
sitemaps = {
|
||||||
|
|
Loading…
Reference in a new issue