Commit 168eef3f authored by Daniel W Bond's avatar Daniel W Bond
Browse files

killing off the myriad old ways of loading in building information

parent b7ef4e1f
import re
from housing.models import Building, Floor, Room
with open('buildingFloors.txt','r') as building_floors:
for lines in building_floors:
lines.strip("\n")
pattern = re.compile("[A-Z a-z]")
if (pattern.match(lines))
greg_building = Building.objects.create(name=lines)
greg_building.save()
else
building_floor = Floor.objects.create(number=int(lines), building = greg_building)
building_floor.save()
with open('roomNunbers.txt','r') as roomnums:
for (morelines in roomnums):
morelines.strip("\n")
pattern = re.compile("[A-Z a-z]")
if (morelines is "Shenandoah" or morelines is "Aquia" or morelines is "Rappahannock"):
neighborhood = morelines
else (pattern.match(morelines)):
roomBuilding = morelines
while not(pattern.match(morelines))):
if (roomBuilding is "Commonwealth" or roomBuilding is "Dominion"):
room = Room.objects.create(number=int(morelines), floor=int(morelines[1]))
room.save()
else:
room = Room.objects.create(number=int(morelines), floor=int(morelines[0]))
room.save()
\ No newline at end of file
This diff is collapsed.
Adams
101
102
103
104
105
107
108
110
111
112
113
114
115
116
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
Harrison
106
107
108
109
110
111
112
113
201
202
203
204
205
206
207
208
209
210
211
213
215
301
302
303
304
305
306
307
308
309
310
311
312
313
315
Jackson
101
102
103
104
105
106
107
108
109
110
111
112
114
115
116
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
301
302
303
305
306
307
308
309
310
311
313
314
315
316
Jefferson
101
103
104
105
106
107
108
109
110
111
112
113
114
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
Kennedy
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
301
302
303
305
306
307
308
309
310
312
313
314
315
Lincoln
101
102
103
104
105
107
108
110
111
112
113
114
115
116
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
301
302
303
304
305
306
307
309
310
311
312
313
314
315
Madison
101
102
103
104
106
107
108
109
110
112
113
114
201
202
203
204
205
206
207
208
209
210
211
212
214
215
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
Monroe
101
103
104
105
106
107
108
109
110
111
112
113
114
115
201
202
203
204
205
206
207
208
209
210
211
212
214
215
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
Roosevelt
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
301
302
303
305
306
307
308
309
310
312
313
314
315
Truman
101
102
103
104
105
106
107
109
110
111
114
115
116
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
301
302
303
305
306
307
308
309
310
311
313
314
315
316
Wilson
101
103
104
105
106
107
108
109
110
111
112
113
114
115
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
Washington
101
102
103
104
106
107
108
109
110
111
112
113
114
115
201
202
203
204
205
206
207
208
209
210
211
212
214
215
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
Amherst
1003
1004
1005
1006
1007
1008
1010
1011
1012
1013
1014
1015
1016
2002
2003
2004
2005
2006
2007
2008
2010
2011
2012
2013
2014
2015
2016
3002
3003
3004
3005
3006
3007
3008
3010
3011
3012
3013
3014
3015
3016
Brunswick
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1013
1014
1015
1016
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2013
2014
2015
2016
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3013
3014
3015
3016
Carroll
1003
1004
1005
1006
1007
1008
1010
1011
1012
1013
1014
1015