Commit 371e591c authored by Daniel W Bond's avatar Daniel W Bond
Browse files

added support for (dumbly named) student apartments

parent 91c9d5a7
......@@ -135,3 +135,39 @@ Tidewater
3
4
5
Apartment 1
1
2
3
Apartment 2
1
2
3
Apartment 3
1
2
3
Apartment 4
1
2
3
Apartment 5
1
2
3
Apartment 6
1
2
3
Apartment 7
1
2
3
Apartment 8
1
2
3
Apartment 9
1
2
3
......@@ -1695,3 +1695,133 @@ Tidewater
525
502
503
Apartment 1
101
102
103
104
105
201
202
203
204
205
301
302
303
304
305
Apartment 2
101
102
103
104
201
202
203
204
205
301
302
303
304
305
Apartment 3
101
102
103
104
105
201
202
203
204
205
301
302
303
304
305
Apartment 4
101
102
103
104
201
202
203
204
205
301
302
303
304
305
Apartment 5
102
103
201
202
203
204
301
302
303
304
Apartment 6
101
102
103
104
201
202
203
204
301
302
303
304
Apartment 7
101
102
103
104
105
201
202
203
204
205
301
302
303
304
305
Apartment 8
101
102
103
104
201
202
203
204
205
301
302
303
304
305
Apartment 9
101
102
103
104
201
202
203
204
301
302
303
304
......@@ -14,10 +14,17 @@ from housing.models import Building, Floor, Room
# check if there are floors already in the database
# check if there are rooms already in the database
# fail if there is already stuff there?
# building name, neighborhood
mason_housing = { 'Adams': 'sh',
'Apartment 1': 'aq',
'Apartment 2': 'aq',
'Apartment 3': 'aq',
'Apartment 4': 'aq',
'Apartment 5': 'aq',
'Apartment 6': 'aq',
'Apartment 7': 'aq',
'Apartment 8': 'aq',
'Apartment 9': 'aq',
'Amherst': 'ra',
'Blue Ridge': 'ra',
'Brunswick': 'ra',
......@@ -49,8 +56,7 @@ mason_housing = { 'Adams': 'sh',
'Whitetop': 'aq',
'Wilson': 'sh', }
# Student Apartments -- multiple buildings
# Townhouses -- multiple buildings
# Townhouses -- really whacky naming
# Beacon Hall -- graduate students
# Liberty Square -- Weird letters in name
# Mason Global Center -- international students
......@@ -79,7 +85,7 @@ new_floors = 0
with open('housing/buildingFloors.txt') as buildings:
for line in buildings:
line = line.strip()
if re.match('[a-z A-z]', line):
if re.match('^[a-z A-Z]*( {1}\d)?$', line):
current_building = Building.objects.get(name=line)
print(current_building)
else:
......@@ -97,7 +103,7 @@ new_rooms = 0
with open('housing/building_rooms.txt') as rooms:
for line in rooms:
line = line.strip()
if re.match('[a-z A-Z]', line):
if re.match('^[a-z A-Z]*( {1}\d)?$', line):
current_building = Building.objects.get(name=line)
print(current_building)
else:
......
......@@ -75,7 +75,7 @@
<div class="row">
<div class="col-md-12">
<p>The following Mason housing locations are not currently supported:</p>
<p>Liberty Square, Beacon Hall, Mason Global Center, Piedmont, Tidewater, Student Apartments, and the Townhouses</p>
<p>Liberty Square, Beacon Hall, Mason Global Center, and the Townhouses</p>
</div>
</div>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment