Add a feed for documents on the IESG telechat.
Improve the admin interface for iesg_login and irtf rg's and chairs. - Legacy-Id: 1138
This commit is contained in:
parent
b1ded59390
commit
b915d03c58
|
@ -253,11 +253,11 @@ class PersonOrOrgInfo(models.Model):
|
|||
# could use a mapping for user_level
|
||||
class IESGLogin(models.Model):
|
||||
USER_LEVEL_CHOICES = (
|
||||
('0', 'Secretariat'),
|
||||
('1', 'IESG'),
|
||||
('2', 'ex-IESG'),
|
||||
('3', 'Level 3'),
|
||||
('4', 'Comment Only(?)'),
|
||||
(0, 'Secretariat'),
|
||||
(1, 'IESG'),
|
||||
(2, 'ex-IESG'),
|
||||
(3, 'Level 3'),
|
||||
(4, 'Comment Only(?)'),
|
||||
)
|
||||
id = models.AutoField(primary_key=True)
|
||||
login_name = models.CharField(blank=True, maxlength=255)
|
||||
|
@ -445,7 +445,7 @@ class BallotInfo(models.Model): # Added by Michael Lee
|
|||
ballot_issued = models.IntegerField(null=True, blank=True)
|
||||
def __str__(self):
|
||||
try:
|
||||
return "Ballot for %s" % self.drafts.filter(primary_flag=1)
|
||||
return "Ballot for %s" % self.drafts.get(primary_flag=1)
|
||||
except IDInternal.DoesNotExist:
|
||||
return "Ballot ID %d (no I-D?)" % (self.ballot)
|
||||
def remarks(self):
|
||||
|
@ -587,6 +587,10 @@ class DocumentComment(models.Model):
|
|||
return self.created_by.login_name
|
||||
else:
|
||||
return "system"
|
||||
def datetime(self):
|
||||
# this is just a straightforward combination, except that the time is
|
||||
# stored incorrectly in the database.
|
||||
return datetime.datetime.combine( self.date, datetime.time( * [int(s) for s in self.time.split(":")] ) )
|
||||
class Meta:
|
||||
db_table = 'document_comments'
|
||||
|
||||
|
@ -921,18 +925,22 @@ class IRTF(models.Model):
|
|||
name = models.CharField(blank=True, maxlength=255, db_column='irtf_name')
|
||||
charter_text = models.TextField(blank=True)
|
||||
meeting_scheduled = models.BooleanField(null=True, blank=True)
|
||||
def __str__(self):
|
||||
return self.acronym
|
||||
class Meta:
|
||||
db_table = 'irtf'
|
||||
verbose_name="IRTF Research Group"
|
||||
class Admin:
|
||||
pass
|
||||
|
||||
class IRTFChair(models.Model):
|
||||
irtf = models.ForeignKey(IRTF)
|
||||
irtf = models.ForeignKey(IRTF, edit_inline=models.STACKED, num_in_admin=2, core=True)
|
||||
person = models.ForeignKey(PersonOrOrgInfo, db_column='person_or_org_tag', raw_id_admin=True)
|
||||
def __str__(self):
|
||||
return "%s is chair of %s" % (self.person, self.irtf)
|
||||
class Meta:
|
||||
db_table = 'irtf_chairs'
|
||||
class Admin:
|
||||
pass
|
||||
verbose_name="IRTF Research Group Chair"
|
||||
|
||||
# Not a model, but it's related.
|
||||
# This is used in the view to represent documents
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
# Copyright The IETF Trust 2007, All Rights Reserved
|
||||
# Copyright The IETF Trust 2007, 2008, All Rights Reserved
|
||||
|
||||
from django.contrib.syndication.feeds import Feed
|
||||
from django.utils.feedgenerator import Atom1Feed
|
||||
from ietf.iesg.models import TelechatMinutes
|
||||
from ietf.idtracker.models import IDInternal
|
||||
import datetime
|
||||
|
||||
class IESGMinutes(Feed):
|
||||
title = "IESG Telechat Minutes"
|
||||
|
@ -22,3 +24,29 @@ class IESGMinutes(Feed):
|
|||
def item_pubdate(self, item):
|
||||
# (slightly better would be 0900 Eastern on this date)
|
||||
return item.telechat_date
|
||||
|
||||
class IESGAgenda(Feed):
|
||||
title = "IESG Telechat Agenda"
|
||||
link = "http://www.ietf.org/IESG/agenda.html"
|
||||
subtitle = "Documents on upcoming IESG Telechat Agendas."
|
||||
feed_type = Atom1Feed
|
||||
|
||||
def items(self):
|
||||
return IDInternal.objects.filter(agenda=1).order_by('telechat_date')
|
||||
|
||||
def item_categories(self, item):
|
||||
return [ str(item.telechat_date) ]
|
||||
|
||||
def item_pubdate(self, item):
|
||||
f = item.comments().filter(comment_text__startswith='Placed on agenda for telechat')
|
||||
try:
|
||||
comment = f[0]
|
||||
date = comment.datetime()
|
||||
except IndexError:
|
||||
date = datetime.datetime.now() #XXX
|
||||
return date
|
||||
|
||||
def item_author_name(self, item):
|
||||
return str( item.job_owner )
|
||||
def item_author_email(self, item):
|
||||
return item.job_owner.person.email()[1]
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
from django.conf.urls.defaults import patterns, include, handler404, handler500
|
||||
|
||||
from ietf.iesg.feeds import IESGMinutes
|
||||
from ietf.iesg.feeds import IESGMinutes, IESGAgenda
|
||||
from ietf.idtracker.feeds import DocumentComments, InLastCall
|
||||
from ietf.ipr.feeds import LatestIprDisclosures
|
||||
from ietf.liaisons.feeds import Liaisons
|
||||
|
@ -17,6 +17,7 @@ from django.conf import settings
|
|||
|
||||
feeds = {
|
||||
'iesg-minutes': IESGMinutes,
|
||||
'iesg-agenda': IESGAgenda,
|
||||
'last-call': InLastCall,
|
||||
'comments': DocumentComments,
|
||||
'ipr': LatestIprDisclosures,
|
||||
|
|
Loading…
Reference in a new issue