6767
6868
6969# NomCom
70- Group .objects .filter (acronym__startswith = "nomcom" ).exclude (acronym = "nomcom" ).delete ()
70+ # Group.objects.filter(acronym__startswith="nomcom").exclude(acronym="nomcom").delete()
7171
7272for o in ChairsHistory .objects .filter (chair_type = Role .NOMCOM_CHAIR ).order_by ("start_year" ):
73- group = Group ()
74- group . acronym = "nomcom%s" % o .start_year
73+ print "importing ChairsHistory/Nomcom" , o . pk , "nomcom%s" % o . start_year
74+ group , _ = Group . objects . get_or_create ( acronym = "nomcom%s" % o .start_year )
7575 group .name = "IAB/IESG Nominating Committee %s/%s" % (o .start_year , o .end_year )
7676 if o .chair_type .person == o .person :
7777 s = state_names ["active" ]
9797
9898# Area
9999for o in Area .objects .all ():
100- group , _ = Group .objects .get_or_create (acronym = o .area_acronym .acronym )
100+ print "importing Area" , o .pk , o .area_acronym .acronym
101+
102+ try :
103+ group = Group .objects .get (acronym = o .area_acronym .acronym )
104+ except Group .DoesNotExist :
105+ group = Group (acronym = o .area_acronym .acronym )
106+ group .id = o .area_acronym_id # transfer id
107+
101108 group .name = o .area_acronym .name
102109 if o .status .status == "Active" :
103110 s = state_names ["active" ]
127134
128135# IRTF
129136for o in IRTF .objects .all ():
137+ print "importing IRTF" , o .pk , o .acronym
138+
130139 try :
131140 group = Group .objects .get (acronym = o .acronym .lower ())
132141 except Group .DoesNotExist :
144153 # FIXME: missing fields from old: meeting_scheduled
145154
146155# IETFWG, AreaGroup
147- for o in IETFWG .objects .all ():
156+ for o in IETFWG .objects .all ().order_by ("pk" ):
157+ print "importing IETFWG" , o .pk , o .group_acronym .acronym
158+
148159 try :
149160 group = Group .objects .get (acronym = o .group_acronym .acronym )
150161 except Group .DoesNotExist :
198209 print "no area/parent for" , group .acronym , group .name , group .type , group .state
199210
200211 group .list_email = o .email_address if o .email_address else ""
212+ l = o .email_archive .strip () if o .email_archive else ""
213+ if l in ("none" , "not available" ):
214+ l = ""
215+ group .list_pages = l
201216 group .comments = o .comments .strip () if o .comments else ""
202217
203218 group .save ()
@@ -219,4 +234,4 @@ def import_date_event(name):
219234 import_date_event ("concluded" )
220235 # dormant_date is empty on all so don't bother with that
221236
222- # FIXME: missing fields from old: meeting_scheduled, email_subscribe, email_keyword, email_archive, last_modified_date, meeting_scheduled_old
237+ # FIXME: missing fields from old: meeting_scheduled, email_subscribe, email_keyword, last_modified_date, meeting_scheduled_old
0 commit comments