Skip to content

Commit 8f0b8a9

Browse files
committed
Checkpoint for demonstration/discussion in Dallas. More development expected afterwards.
- Legacy-Id: 9250
2 parents 0584ccc + 9421ea9 commit 8f0b8a9

21 files changed

Lines changed: 3145 additions & 2718 deletions

ietf/meeting/helpers.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@ def build_all_agenda_slices(meeting):
6767
date_slices = {}
6868

6969
for ts in meeting.timeslot_set.exclude(type__in=['reg','break']).order_by('time','name'):
70+
#for ts in meeting.timeslot_set.exclude(type__in=['reg','break','other']).order_by('time','name'):
71+
#for ts in meeting.timeslot_set.order_by('time','name'):
72+
#for ts in meeting.timeslot_set.filter(type='offagenda').order_by('time','name'):
7073
ymd = ts.time.date()
7174

7275
if ymd not in date_slices and ts.location != None:
Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
# -*- coding: utf-8 -*-
2+
from __future__ import unicode_literals
3+
4+
import datetime
5+
from django.db import migrations
6+
7+
8+
def backfill_91_other_meetings(apps, schema_editor):
9+
10+
Meeting = apps.get_model('meeting', 'Meeting')
11+
Schedule = apps.get_model('meeting', 'Schedule')
12+
ScheduledSession = apps.get_model('meeting', 'ScheduledSession')
13+
Room = apps.get_model('meeting', 'Room')
14+
Group = apps.get_model('group', 'Group')
15+
Person = apps.get_model('person', 'Person')
16+
17+
ietf91 = Meeting.objects.filter(number=91).first()
18+
19+
if not ietf91:
20+
print "IETF91 not found, no data changed"
21+
else:
22+
agenda91 = Schedule.objects.get(meeting=ietf91,pk=ietf91.agenda.pk)
23+
24+
south_pacific_1 = Room.objects.get(meeting=ietf91,name="South Pacific 1")
25+
south_pacific_2 = Room.objects.get(meeting=ietf91,name="South Pacific 2")
26+
rainbow_12 = Room.objects.get(meeting=ietf91,name="Rainbow Suite 1/2")
27+
lehua_suite = Room.objects.get(meeting=ietf91,name="Lehua Suite")
28+
kahili = Room.objects.get(meeting=ietf91,name="Kahili")
29+
coral_2 = Room.objects.get(meeting=ietf91,name="Coral 2")
30+
31+
south_pacific_3 = Room.objects.create(meeting=ietf91,name="South Pacific 3",capacity=20)
32+
rainbow_suite_3 = Room.objects.create(meeting=ietf91,name="Rainbow Suite 3",capacity=20)
33+
rainbow_23 = Room.objects.create(meeting=ietf91,name="Rainbow Suite 2/3",capacity=210)
34+
south_pacific_34 = Room.objects.create(meeting=ietf91,name="South Pacific 3/4",capacity=210)
35+
iolani_67 = Room.objects.create(meeting=ietf91,name="Iolani 6/7",capacity=40)
36+
sea_pearl_12 = Room.objects.create(meeting=ietf91,name="Sea Pearl 1/2",capacity=40)
37+
sea_pearl_2 = Room.objects.create(meeting=ietf91,name="Sea Pearl 2",capacity=20)
38+
coral_lounge = Room.objects.create(meeting=ietf91,name="Coral Lounge", capacity=1200)
39+
hibiscus = Room.objects.create(meeting=ietf91,name="Hibiscus", capacity=20)
40+
tiare = Room.objects.create(meeting=ietf91,name="Tiare Suite", capacity=20)
41+
42+
iesg = Group.objects.get(acronym='iesg')
43+
iab = Group.objects.get(acronym='iab')
44+
rsoc = Group.objects.get(acronym='rsoc')
45+
iaoc = Group.objects.get(acronym='iaoc')
46+
nomcom = Group.objects.get(acronym='nomcom2014')
47+
isoc = Group.objects.get(acronym='isoc')
48+
secr = Group.objects.get(acronym='secretariat')
49+
isocbot = Group.objects.create(acronym='isocbot',name="Internet Society Board of Trustees",state_id='active',type_id='isoc',parent=isoc)
50+
isocfell = Group.objects.create(acronym='isocfell',name="Internet Society Fellows",state_id='active',type_id='isoc',parent=isoc)
51+
52+
system = Person.objects.get(name='(System)')
53+
54+
for d, h, m, duration, type_id, groups, room, slotname, label in [
55+
( 9, 8, 0, 120, 'offagenda', [secr], rainbow_suite_3, 'WEIRDS Interop', 'WEIRDS Interop'),
56+
( 9, 8, 30, 90, 'lead', [iesg], south_pacific_2, 'Breakfast', None),
57+
( 9, 9, 0, 240, 'offagenda', [secr], lehua_suite, 'RMCAT Interim', 'RMCAT Interim Meeting'),
58+
( 9, 9, 0, 60, 'lead', [nomcom], iolani_67, 'Breakfast', 'Nomcom Breakfast'),
59+
( 9, 9, 0, 150, 'lead', [iesg], south_pacific_2, 'Meeting', None),
60+
( 9, 9, 0, 360, 'offagenda', [secr], hibiscus, 'Meeting', 'RootOPS'),
61+
( 9, 9, 30, 360, 'offagenda', [secr], kahili, 'TLS Interim', 'TLS WG Interim'),
62+
( 9, 11, 0, 480, 'offagenda', [secr], coral_lounge, 'T-Shirt Distribution', 'T-shirt Distribution'),
63+
( 9, 11, 30, 150, 'lead', [iesg,iab], south_pacific_2, 'Lunch', 'IAB/IESG Lunch'),
64+
( 9, 12, 0, 360, 'offagenda', [secr], south_pacific_1, 'Terminal Room', 'Terminal Room Open to Attendees'),
65+
( 9, 14, 0, 180, 'lead', [iab], south_pacific_2, 'Meeting', None),
66+
( 9, 16, 0, 120, 'offagenda', [secr], coral_2, 'Meeting', 'Web Object Encryption'),
67+
( 9, 17, 0, 120, 'offagenda', [secr], sea_pearl_12, 'Reception', "Companion's Reception"), # Should this appear on agenda?
68+
( 9, 19, 0, 180, 'offagenda', [isocfell], rainbow_23, 'Dinner', 'ISOC Fellows Reception/Dinner'),
69+
( 9, 19, 0, 180, 'offagenda', [secr], lehua_suite, 'Meeting', 'Huawei'),
70+
( 9, 21, 0, 180, 'lead', [secr], sea_pearl_12, 'Gathering', 'AMS/IESG/IABIAOC Gathering'),
71+
( 10, 0, 0, 1440, 'offagenda', [secr], south_pacific_1, 'Terminal Room', 'Terminal Room Open to Attendees'),
72+
( 10, 7, 0, 120, 'lead', [iesg,iab], south_pacific_2, 'Breakfast', 'IESG/IAB Breakfast'),
73+
( 10, 7, 0, 120, 'lead', [nomcom], iolani_67, 'Breakfast', 'Nomcom Breakfast'),
74+
( 10, 8, 0, 600, 'offagenda', [secr], coral_lounge, 'T-shirt Distribution', 'T-shirt Distribution'),
75+
( 10, 11, 30, 90, 'offagenda', [secr], south_pacific_2, 'Meeting', 'OPS Directorate Meeting'),
76+
( 10, 11, 30, 90, 'offagenda', [secr], rainbow_suite_3, 'Meeting', 'IETF/3GPP Meeting'),
77+
( 10, 11, 30, 90, 'offagenda', [secr], lehua_suite, 'Meeting', 'RTG Area Meeting'),
78+
( 10, 19, 0, 240, 'offagenda', [secr], south_pacific_2, 'Meeting', 'Huawei'),
79+
( 11, 0, 0, 1440, 'offagenda', [secr], south_pacific_1, 'Terminal Room', 'Terminal Room Open to Attendees'),
80+
( 11, 7, 0, 120, 'lead', [iesg], south_pacific_2, 'Breakfast', None),
81+
( 11, 7, 0, 120, 'lead', [nomcom], iolani_67, 'Breakfast', 'Nomcom Breakfast'),
82+
( 11, 7, 0, 120, 'lead', [iab], rainbow_suite_3, 'Breakfast', None),
83+
( 11, 7, 0, 60, 'lead', [iab], tiare, 'Meeting', 'Vendor Selection Committee Meeting'),
84+
( 11, 8, 0, 600, 'offagenda', [secr], coral_lounge, 'T-shirt Distribution', 'T-shirt Distribution'),
85+
( 11, 9, 0, 90, 'offagenda', [secr], south_pacific_2, 'Meeting', 'DHCPv6bis Team Meeting'),
86+
( 11, 11, 30, 90, 'offagenda', [secr], south_pacific_2, 'Meeting', 'SECdir Meeting'),
87+
( 11, 11, 30, 90, 'offagenda', [secr], rainbow_suite_3, 'Lunch', 'RSAG/ISEB Lunch'),
88+
( 11, 16, 0, 240, 'offagenda', [secr], south_pacific_2, 'Meeting', 'Verisign Corporate Meeting'),
89+
( 12, 0, 0, 1440, 'offagenda', [secr], south_pacific_1, 'Terminal Room', 'Terminal Room Open to Attendees'),
90+
( 12, 7, 30, 90, 'lead', [iaoc], south_pacific_3, 'Breakfast', None),
91+
( 12, 7, 0, 120, 'lead', [nomcom], iolani_67, 'Breakfast', 'Nomcom Breakfast'),
92+
( 12, 8, 0, 540, 'offagenda', [secr], coral_lounge, 'T-shirt Distribution', 'T-shirt Distribution'),
93+
( 12, 8, 0, 240, 'offagenda', [secr], south_pacific_2, 'Meeting', 'DIME WG'),
94+
( 12, 11, 30, 90, 'offagenda', [secr], rainbow_suite_3, 'Lunch', 'RFC Editor Lunch'),
95+
( 12, 15, 0, 120, 'offagenda', [secr], south_pacific_2, 'Meeting', 'YANG Advice'),
96+
( 12, 17, 0, 240, 'offagenda', [secr], rainbow_suite_3, 'Meeting', 'Huawei (POC Wil Liu)'),
97+
( 12, 20, 0, 150, 'offagenda', [secr], south_pacific_2, 'Meeting', 'ICANN SSAC'),
98+
( 13, 0, 0, 1440, 'offagenda', [secr], south_pacific_1, 'Terminal Room', 'Terminal Room Open to Attendees'),
99+
( 13, 7, 0, 120, 'lead', [iab], rainbow_suite_3, 'Breakfast', None),
100+
( 13, 7, 0, 120, 'lead', [nomcom], iolani_67, 'Breakfast', 'Nomcom Breakfast'),
101+
( 13, 11, 30, 90, 'lead', [iab], sea_pearl_2, 'Meeting', 'IAB Liaison Oversight'),
102+
( 13, 11, 30, 90, 'lead', [rsoc], rainbow_suite_3, 'Lunch', None),
103+
( 14, 0, 0, 900, 'offagenda', [secr], south_pacific_1, 'Terminal Room', 'Terminal Room Open to Attendees'),
104+
( 14, 7, 0, 120, 'lead', [nomcom], iolani_67, 'Breakfast', 'Nomcom Breakfast'),
105+
( 14, 11, 0, 360, 'offagenda', [isoc], south_pacific_34,'Meeeting', 'ISOC AC Meeting'),
106+
( 14, 13, 30, 90, 'lead', [iesg,iab], south_pacific_2, 'Lunch', 'IESG/IAB Lunch'),
107+
( 14, 18, 0, 60, 'offagenda', [isocbot], rainbow_23, 'Reception', 'ISOC Board Reception for IETF Leadership'),
108+
( 14, 19, 0, 180, 'offagenda', [isocbot], rainbow_23, 'Dinner', 'ISOC Board Dinner for IETF Leadership'),
109+
( 15, 8, 0, 60, 'offagenda', [isocbot], rainbow_12, 'Breakfast', 'ISOC Board of Trustees Breakfast'),
110+
( 15, 8, 0, 540, 'offagenda', [isocbot], south_pacific_34,'Meeting', 'ISOC Board of Trustees Meeting'),
111+
( 15, 12, 0, 60, 'offagenda', [isocbot], rainbow_12, 'Lunch', 'ISOC Board of Trustees Lunch'),
112+
( 16, 8, 0, 60, 'offagenda', [isocbot], rainbow_12, 'Breakfast', 'ISOC Board of Trustees Breakfast'),
113+
( 16, 8, 0, 540, 'offagenda', [isocbot], south_pacific_34,'Meeting', 'ISOC Board of Trustees Meeting'),
114+
( 16, 12, 0, 60, 'offagenda', [isocbot], rainbow_12, 'Lunch', 'ISOC Board of Trustees Lunch'),
115+
]:
116+
ts = ietf91.timeslot_set.create(type_id=type_id, name=slotname,
117+
time=datetime.datetime(2014,11,d,h,m,0),
118+
duration=datetime.timedelta(minutes=duration),
119+
location=room,show_location=(type_id not in ['lead','offagenda']))
120+
for group in groups:
121+
session = ietf91.session_set.create(name= label or "%s %s"%(group.acronym.upper(),slotname),
122+
group=group, attendees=25,
123+
requested=datetime.datetime(2014,11,1,0,0,0),
124+
requested_by=system, status_id='sched')
125+
ScheduledSession.objects.create(schedule=agenda91, timeslot=ts, session=session)
126+
127+
128+
129+
130+
class Migration(migrations.Migration):
131+
132+
dependencies = [
133+
('meeting', '0004_auto_20150308_0446'),
134+
('name', '0003_auto_20150318_1140'),
135+
('group', '0003_auto_20150304_0743'),
136+
('person', '0004_auto_20150308_0440'),
137+
]
138+
139+
operations = [
140+
migrations.RunPython(backfill_91_other_meetings)
141+
]

ietf/meeting/models.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -370,14 +370,18 @@ def __unicode__(self):
370370
return u"%s: %s-%s %s, %s" % (self.meeting.number, self.time.strftime("%m-%d %H:%M"), (self.time + self.duration).strftime("%H:%M"), self.name, location)
371371
def end_time(self):
372372
return self.time + self.duration
373-
def get_location(self):
373+
def get_hidden_location(self):
374374
location = self.location
375375
if location:
376376
location = location.name
377377
elif self.type_id == "reg":
378378
location = self.meeting.reg_area
379379
elif self.type_id == "break":
380380
location = self.meeting.break_area
381+
return location
382+
383+
def get_location(self):
384+
location = self.get_hidden_location()
381385
if not self.show_location:
382386
location = ""
383387
return location
@@ -626,8 +630,7 @@ def area_list(self):
626630
.distinct() )
627631

628632
def groups(self):
629-
return Group.objects.filter(type__slug__in=['wg', 'rg', 'ag', 'iab'], parent__isnull=False,
630-
session__scheduledsession__schedule=self).distinct().order_by('parent__acronym', 'acronym')
633+
return Group.objects.filter(type__slug__in=['wg', 'rg', 'ag', 'iab'], parent__isnull=False, session__scheduledsession__schedule=self).exclude(session__scheduledsession__timeslot__type__in=['lead','offagenda']).distinct().order_by('parent__acronym', 'acronym')
631634

632635
# calculate badness of entire schedule
633636
def calc_badness(self):

ietf/meeting/test_data.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ def make_meeting_test_data():
2020
pname = RoomResourceName.objects.create(name='projector',slug='proj')
2121
projector = ResourceAssociation.objects.create(name=pname,icon="notfound.png",desc="Basic projector")
2222
room = Room.objects.create(meeting=meeting, name="Test Room", capacity=123)
23+
breakfast_room = Room.objects.create(meeting=meeting, name="Breakfast Room", capacity=40)
2324
room.resources = [projector]
2425

2526
# mars WG
@@ -41,6 +42,17 @@ def make_meeting_test_data():
4142
scheduled=datetime.datetime.now())
4243
ScheduledSession.objects.create(timeslot=slot, session=ames_session, schedule=schedule)
4344

45+
# IESG breakfast
46+
breakfast_slot = TimeSlot.objects.create(meeting=meeting, type_id="lead", duration=90 * 60,
47+
location=breakfast_room,
48+
time=datetime.datetime.combine(datetime.date.today(),datetime.time(7,0)))
49+
iesg_session = Session.objects.create(meeting=meeting, group=Group.objects.get(acronym="iesg"),
50+
name="IESG Breakfast",
51+
attendees=25, requested_by=system_person,
52+
requested_duration=20, status_id="schedw",
53+
scheduled=datetime.datetime.now())
54+
ScheduledSession.objects.create(timeslot=breakfast_slot, session=iesg_session, schedule=schedule)
55+
4456
meeting.agenda = schedule
4557
meeting.save()
4658

ietf/meeting/tests_api.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,10 @@ def test_create_new_room(self):
152152
self.assertTrue(meeting.room_set.filter(name="new room"))
153153

154154
timeslots_after = meeting.timeslot_set.count()
155-
self.assertEqual((timeslots_after - timeslots_before), (meeting.room_set.count() - 1) * timeslots_before)
155+
# It's not clear that what that ajax function is doing is the right thing to do,
156+
# but it currently makes a new timeslot for any existing timeslot.
157+
# The condition tested below relies on the timeslots before this test all having different start and end times
158+
self.assertEqual( timeslots_after, 2 * timeslots_before)
156159

157160
def test_delete_room(self):
158161
meeting = make_meeting_test_data()
@@ -201,15 +204,15 @@ def test_sessions_json(self):
201204
r = self.client.get(url)
202205
self.assertEqual(r.status_code, 200)
203206
info = json.loads(r.content)
204-
self.assertEqual(set([x['short_name'] for x in info]),set(['mars','ames']))
207+
self.assertEqual(set([x['short_name'] for x in info]),set([s.session.short_name for s in meeting.agenda.scheduledsession_set.all()]))
205208

206209
schedule = meeting.agenda
207210
url = urlreverse("ietf.meeting.ajax.scheduledsessions_json",
208211
kwargs=dict(num=meeting.number,owner=schedule.owner_email(),name=schedule.name))
209212
r = self.client.get(url)
210213
self.assertEqual(r.status_code, 200)
211214
info = json.loads(r.content)
212-
self.assertEqual(len(info),2)
215+
self.assertEqual(len(info),schedule.scheduledsession_set.count())
213216

214217

215218
def test_slot_json(self):

ietf/meeting/tests_views.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
from ietf.doc.models import Document
1212
from ietf.meeting.models import Session, TimeSlot
1313
from ietf.meeting.test_data import make_meeting_test_data
14-
from ietf.utils.test_utils import TestCase
14+
from ietf.utils.test_utils import TestCase, login_testing_unauthorized
1515

1616
class MeetingTests(TestCase):
1717
def setUp(self):
@@ -99,6 +99,13 @@ def test_agenda(self):
9999
self.assertTrue(session.group.acronym in agenda_content)
100100
self.assertTrue(slot.location.name in agenda_content)
101101

102+
def test_agenda_by_room(self):
103+
meeting = make_meeting_test_data()
104+
url = urlreverse("ietf.meeting.views.agenda_by_room",kwargs=dict(num=meeting.number))
105+
login_testing_unauthorized(self,"secretary",url)
106+
r = self.client.get(url,kwargs=dict(num=meeting.number))
107+
self.assertTrue(all([x in r.content for x in ['mars','IESG Breakfast','Test Room','Breakfast Room']]))
108+
102109
def test_materials(self):
103110
meeting = make_meeting_test_data()
104111
session = Session.objects.filter(meeting=meeting, group__acronym="mars").first()

ietf/meeting/urls.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
(r'^(?P<num>\d+)/agenda(?P<ext>.txt)$', views.agenda),
3636
(r'^(?P<num>\d+)/agenda.ics$', views.ical_agenda),
3737
(r'^(?P<num>\d+)/agenda(?P<ext>.csv)$', views.agenda),
38+
(r'^(?P<num>\d+)/agenda/by-room$', views.agenda_by_room),
3839
(r'^(?P<num>\d+)/agendas/edit$', views.edit_agendas),
3940
(r'^(?P<num>\d+)/timeslots/edit$', views.edit_timeslots),
4041
(r'^(?P<num>\d+)/rooms$', ajax.timeslot_roomsurl),

0 commit comments

Comments
 (0)