|
| 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_92_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 | + Session = apps.get_model('meeting', 'Session') |
| 15 | + Group = apps.get_model('group', 'Group') |
| 16 | + Person = apps.get_model('person', 'Person') |
| 17 | + |
| 18 | + ietf92 = Meeting.objects.filter(number=92).first() |
| 19 | + |
| 20 | + if not ietf92: |
| 21 | + print "IETF92 not found, no data changed" |
| 22 | + else: |
| 23 | + |
| 24 | + # Clear out one orphaned ill-configured Session object |
| 25 | + qs = Session.objects.filter(meeting__number=92,name__icontains='beverage break').exclude(type_id='break') |
| 26 | + if qs.count()==1: |
| 27 | + qs.delete() |
| 28 | + |
| 29 | + agenda92 = Schedule.objects.get(meeting=ietf92,pk=ietf92.agenda.pk) |
| 30 | + |
| 31 | + map_existing = { |
| 32 | + 'Regency Ballroom': 'Lounge', |
| 33 | + 'Garden Terrace Level': 'Meet and Greet', |
| 34 | + 'Royal': 'Breakout 1', |
| 35 | + 'Continental': 'Breakout 2', |
| 36 | + 'Far East': 'Breakout 3', |
| 37 | + 'Oak ': 'Breakout 4', |
| 38 | + 'Parisian': 'Breakout 5', |
| 39 | + 'Venetian': 'Breakout 6', |
| 40 | + 'Gold': 'Breakout 7', |
| 41 | + 'International': 'Breakout 8', |
| 42 | + 'Brasserie': 'Terminal Room', |
| 43 | + 'State': 'Office #3 (Secretariat Office)', |
| 44 | + 'French': 'Meeting Room #2 (IESG Meeting Room)', |
| 45 | + } |
| 46 | + |
| 47 | + for name,functional_name in map_existing.items(): |
| 48 | + Room.objects.filter(meeting__number=92,name=name).update(functional_name=functional_name) |
| 49 | + |
| 50 | + regency = Room.objects.get(meeting=ietf92,name='Regency Ballroom') |
| 51 | + garden = Room.objects.get(meeting=ietf92,name='Garden Terrace Level') |
| 52 | + royal = Room.objects.get(meeting=ietf92,name='Royal') |
| 53 | + continental = Room.objects.get(meeting=ietf92,name='Continental') |
| 54 | + far_east = Room.objects.get(meeting=ietf92,name='Far East') |
| 55 | + oak = Room.objects.get(meeting=ietf92,name='Oak ') |
| 56 | + #parisian = Room.objects.get(meeting=ietf92,name='Parisian') |
| 57 | + #venetian = Room.objects.get(meeting=ietf92,name='Venetian') |
| 58 | + #gold = Room.objects.get(meeting=ietf92,name='Gold') |
| 59 | + #international = Room.objects.get(meeting=ietf92,name='International') |
| 60 | + brasserie = Room.objects.get(meeting=ietf92,name='Brasserie') |
| 61 | + state = Room.objects.get(meeting=ietf92,name='State') |
| 62 | + #french = Room.objects.get(meeting=ietf92,name='French') |
| 63 | + |
| 64 | + executive = Room.objects.create(meeting=ietf92,name='Executive',functional_name='Meeting Room #4 (IAOC/IAD)',capacity=20) |
| 65 | + regency_foyer = Room.objects.create(meeting=ietf92,name='Regency Foyer',functional_name='Registration',capacity=1200) |
| 66 | + florentine = Room.objects.create(meeting=ietf92,name='Florentine',functional_name='Meeting Room #1 (IAB)', capacity=40) |
| 67 | + pavilion = Room.objects.create(meeting=ietf92,name='Pavilion',functional_name='Meeting Room #6', capacity=80) |
| 68 | + terrace = Room.objects.create(meeting=ietf92,name='Terrace',functional_name='Meeting Room #7', capacity=80) |
| 69 | + panorama = Room.objects.create(meeting=ietf92,name='Panorama',functional_name='Companion Reception', capacity=200) |
| 70 | + |
| 71 | + regency.session_types.add('offagenda') |
| 72 | + pavilion.session_types.add('offagenda') |
| 73 | + pavilion.session_types.add('lead') |
| 74 | + garden.session_types.add('lead') |
| 75 | + panorama.session_types.add('offagenda') |
| 76 | + executive.session_types.add('lead') |
| 77 | + executive.session_types.add('offagenda') |
| 78 | + regency_foyer.session_types.add('offagenda') |
| 79 | + oak.session_types.add('offagenda') |
| 80 | + continental.session_types.add('offagenda') |
| 81 | + state.session_types.add('offagenda') |
| 82 | + florentine.session_types.add('offagenda') |
| 83 | + terrace.session_types.add('lead') |
| 84 | + terrace.session_types.add('offagenda') |
| 85 | + far_east.session_types.add('offagenda') |
| 86 | + brasserie.session_types.add('offagenda') |
| 87 | + royal.session_types.add('offagenda') |
| 88 | + |
| 89 | + iesg = Group.objects.get(acronym='iesg') |
| 90 | + iab = Group.objects.get(acronym='iab') |
| 91 | + iaoc = Group.objects.get(acronym='iaoc') |
| 92 | + secr = Group.objects.get(acronym='secretariat') |
| 93 | + |
| 94 | + system = Person.objects.get(name='(System)') |
| 95 | + |
| 96 | + for d, h, m, duration, type_id, groups, room, slotname, label in [ |
| 97 | + ( 20, 13, 0, 480, 'offagenda', [secr], brasserie, 'Setup', 'Hackathon: Setup'), |
| 98 | + ( 20, 8, 0, 540, 'offagenda', [secr], executive, 'Meeting', 'DNS OARC Meeting'), |
| 99 | + ( 21, 8, 0, 540, 'offagenda', [secr], executive, 'Meeting', 'DNS OARC Meeting'), |
| 100 | + ( 22, 12, 0, 720, 'offagenda', [secr], brasserie, 'Terminal Room', 'Terminal Room Open to Attendees'), |
| 101 | + ( 22, 11, 0, 480, 'offagenda', [secr], regency_foyer, 'T-Shirt Distribution', 'T-shirt Distribution'), |
| 102 | + ( 22, 19, 0, 120, 'offagenda', [secr], state, 'Meeting', 'CJK Generation Panel coordination informal meeting'), |
| 103 | + ( 22, 19, 0, 120, 'offagenda', [iab], florentine, 'Meeting', 'IAB PrivSec program'), |
| 104 | + ( 22, 8, 30, 90, 'lead', [iesg], pavilion, 'Breakfast', None), |
| 105 | + ( 22, 9, 0, 150, 'lead', [iesg], pavilion, 'Meeting', None), |
| 106 | + ( 22, 11, 30, 150, 'lead', [iab,iesg], pavilion, 'Lunch', 'IESG/IAB Lunch'), |
| 107 | + ( 22, 14, 0, 180, 'lead', [iab], pavilion, 'Meeting', None), |
| 108 | + ( 22, 9, 0, 480, 'offagenda', [secr], terrace, 'Meeting', 'RootOPS'), |
| 109 | + ( 22, 16, 30, 60, 'offagenda', [secr], panorama, 'Reception', "Companion's Reception"), # Should this appear on agenda? |
| 110 | + ( 22, 21, 0, 180, 'lead', [secr], garden, 'Gathering', 'AMS/IESG/IAB/IAOC Gathering'), |
| 111 | + ( 22, 9, 0, 480, 'offagenda', [secr], royal, 'ICNRG', 'ICNRG'), |
| 112 | + ( 22, 19, 0, 180, 'offagenda', [secr], royal, 'Meeting', 'Huawei'), |
| 113 | + ( 22, 12, 30, 240, 'offagenda', [secr], continental, 'Meeting', 'Verisign ROA Workshop'), |
| 114 | + ( 22, 15, 15, 165, 'offagenda', [secr], far_east, 'Meeting', 'RSSAC'), |
| 115 | + ( 22, 9, 0, 150, 'offagenda', [secr], oak, 'Meeting', 'Ericsson'), |
| 116 | + ( 23, 0, 0, 1440, 'offagenda', [secr], brasserie, 'Terminal Room', 'Terminal Room Open to Attendees'), |
| 117 | + ( 23, 8, 0, 600, 'offagenda', [secr], regency_foyer, 'T-Shirt Distribution', 'T-shirt Distribution'), |
| 118 | + ( 23, 0, 0, 1440, 'offagenda', [secr], regency, 'Lounge', 'Lounge'), |
| 119 | + ( 23, 11, 30, 180, 'offagenda', [secr], executive, 'Lunch', 'ICANN Lunch'), |
| 120 | + ( 23, 7, 0, 120, 'lead', [iab,iesg], pavilion, 'Breakfast', 'IESG/IAB Breakfast'), |
| 121 | + ( 23, 11, 30, 90, 'offagenda', [secr], pavilion, 'Meeting', 'OPS Directorate Meeting'), |
| 122 | + ( 23, 19, 0, 120, 'offagenda', [secr], pavilion, 'Meeting', 'ACE'), |
| 123 | + ( 23, 7, 30, 90, 'offagenda', [secr], terrace, 'Meeting', 'NRO ECG'), |
| 124 | + ( 23, 11, 30, 90, 'offagenda', [secr], terrace, 'Meeting', 'IETF/3GPP Meeting'), |
| 125 | + ( 23, 19, 0, 120, 'offagenda', [secr], terrace, 'Meeting', 'I2NSF'), |
| 126 | + ( 23, 18, 50, 60, 'offagenda', [secr], royal, 'Meeting', 'Captive Portal Bar BOF'), |
| 127 | + ( 24, 0, 0, 1440, 'offagenda', [secr], brasserie, 'Terminal Room', 'Terminal Room Open to Attendees'), |
| 128 | + ( 24, 8, 0, 600, 'offagenda', [secr], regency_foyer, 'T-Shirt Distribution', 'T-shirt Distribution'), |
| 129 | + ( 24, 0, 0, 1440, 'offagenda', [secr], regency, 'Lounge', 'Lounge'), |
| 130 | + ( 24, 11, 30, 90, 'offagenda', [secr], state, 'Meeting', 'HIAPS'), |
| 131 | + ( 24, 16, 30, 120, 'offagenda', [secr], state, 'Meeting', 'PDF Draft Review'), |
| 132 | + ( 24, 7, 0, 120, 'lead', [iesg], pavilion, 'Breakfast', None), |
| 133 | + ( 24, 11, 30, 90, 'offagenda', [secr], pavilion, 'Meeting', 'SECdir Meeting'), |
| 134 | + ( 24, 7, 0, 120, 'lead', [iab], terrace, 'Breakfast', None), |
| 135 | + ( 24, 9, 0, 120, 'offagenda', [secr], terrace, 'Meeting', 'ICNN DRZK Design Team'), |
| 136 | + ( 24, 11, 30, 90, 'offagenda', [secr], terrace, 'Lunch', 'RSAG/ISEB Lunch'), |
| 137 | + ( 24, 13, 0, 120, 'offagenda', [secr], terrace, 'Meeting', 'SACM'), |
| 138 | + ( 24, 15, 0, 90, 'offagenda', [secr], terrace, 'Meeting', 'RSOC Meeting'), |
| 139 | + ( 24, 17, 30, 60, 'offagenda', [secr], terrace, 'Meeting', 'SACM'), |
| 140 | + ( 24, 11, 30, 90, 'offagenda', [secr], royal, 'Meeting', 'IoT Directorate'), |
| 141 | + ( 25, 0, 0, 1440, 'offagenda', [secr], brasserie, 'Terminal Room', 'Terminal Room Open to Attendees'), |
| 142 | + ( 25, 8, 0, 600, 'offagenda', [secr], regency_foyer, 'T-Shirt Distribution', 'T-shirt Distribution'), |
| 143 | + ( 25, 0, 0, 1440, 'offagenda', [secr], regency, 'Lounge', 'Lounge'), |
| 144 | + ( 25, 8, 0, 60, 'offagenda', [secr], state, 'Meeting', 'SFC Control Plane Offline Discussion'), |
| 145 | + ( 25, 19, 0, 240, 'offagenda', [secr], state, 'Meeting', 'WWG'), |
| 146 | + ( 25, 8, 0, 60, 'offagenda', [secr], florentine, 'Meeting', 'IAB Name Resolution'), |
| 147 | + ( 25, 6, 45, 135, 'lead', [iaoc], executive, 'Breakfast', None), |
| 148 | + ( 25, 11, 30, 90, 'offagenda', [secr], pavilion, 'Meeting', 'RMCAT'), |
| 149 | + ( 25, 19, 0, 120, 'offagenda', [secr], pavilion, 'Meeting', 'I2NSF'), |
| 150 | + ( 25, 8, 0, 60, 'offagenda', [secr], terrace, 'Meeting', 'IETF/IEEE 802 Coordination'), |
| 151 | + ( 25, 11, 30, 90, 'offagenda', [secr], terrace, 'Lunch', 'RFC Editor Lunch'), |
| 152 | + ( 25, 19, 30, 120, 'offagenda', [secr], terrace, 'Dinner', 'SSAC Dinner'), |
| 153 | + ( 26, 0, 0, 1440, 'offagenda', [secr], brasserie, 'Terminal Room', 'Terminal Room Open to Attendees'), |
| 154 | + ( 26, 8, 0, 600, 'offagenda', [secr], regency_foyer, 'T-Shirt Distribution', 'T-shirt Distribution'), |
| 155 | + ( 26, 0, 0, 1440, 'offagenda', [secr], regency, 'Lounge', 'Lounge'), |
| 156 | + ( 26, 7, 30, 90, 'offagenda', [secr], state, 'Breakfast', 'EDU Team Breakfast'), |
| 157 | + ( 26, 14, 0, 120, 'offagenda', [secr], state, 'Meeting', 'JJB'), |
| 158 | + ( 26, 11, 30, 90, 'offagenda', [secr], florentine, 'Meeting', 'IAB Liaison Oversight'), |
| 159 | + ( 26, 18, 0, 150, 'offagenda', [secr], pavilion, 'Meeting', '6LO Security Discussion'), |
| 160 | + ( 26, 7, 0, 120, 'lead', [iab], terrace, 'Breakfast', None), |
| 161 | + ( 26, 17, 40, 60, 'offagenda', [secr], terrace, 'Meeting', 'SACM'), |
| 162 | + ( 26, 19, 30, 150, 'offagenda', [secr], royal, 'Meeting', 'Lavabit'), |
| 163 | + ( 27, 0, 0, 900, 'offagenda', [secr], brasserie, 'Terminal Room', 'Terminal Room Open to Attendees'), |
| 164 | + ( 27, 7, 30, 90, 'offagenda', [secr], executive, 'Meeting', 'Post-Con with Ray'), |
| 165 | + ( 27, 13, 30, 90, 'lead', [iab,iesg], pavilion, 'Lunch', 'IESG/IAB Lunch'), |
| 166 | + ]: |
| 167 | + |
| 168 | + ts = ietf92.timeslot_set.create(type_id=type_id, name=slotname, |
| 169 | + time=datetime.datetime(2015,3,d,h,m,0), |
| 170 | + duration=datetime.timedelta(minutes=duration), |
| 171 | + location=room,show_location=(type_id not in ['lead','offagenda'])) |
| 172 | + for group in groups: |
| 173 | + session = ietf92.session_set.create(name= label or "%s %s"%(group.acronym.upper(),slotname), |
| 174 | + group=group, attendees=25, |
| 175 | + requested=datetime.datetime(2014,11,1,0,0,0), |
| 176 | + requested_by=system, status_id='sched',type_id=type_id) |
| 177 | + ScheduledSession.objects.create(schedule=agenda92, timeslot=ts, session=session) |
| 178 | + |
| 179 | + |
| 180 | +class Migration(migrations.Migration): |
| 181 | + |
| 182 | + dependencies = [ |
| 183 | + ('meeting', '0010_auto_20150501_0732'), |
| 184 | + ('name', '0004_auto_20150318_1140'), |
| 185 | + ('group', '0004_auto_20150430_0847'), |
| 186 | + ('person', '0004_auto_20150308_0440'), |
| 187 | + ] |
| 188 | + |
| 189 | + operations = [ |
| 190 | + migrations.RunPython(backfill_92_other_meetings) |
| 191 | + ] |
0 commit comments