Commit 34a3ec68 authored by Michael Lundquist's avatar Michael Lundquist

Adding fixtures

parent c0432208
Pipeline #4760 passed with stage
in 1 minute and 13 seconds
[{"model": "api.category", "pk": 6, "fields": {"name": "Athletic Facility"}}, {"model": "api.category", "pk": 4, "fields": {"name": "Caf\u00e9"}}, {"model": "api.category", "pk": 3, "fields": {"name": "Convenience Store"}}, {"model": "api.category", "pk": 1, "fields": {"name": "Dining Hall"}}, {"model": "api.category", "pk": 12, "fields": {"name": "Library"}}, {"model": "api.category", "pk": 14, "fields": {"name": "Maker Space"}}, {"model": "api.category", "pk": 10, "fields": {"name": "Office"}}, {"model": "api.category", "pk": 13, "fields": {"name": "Office"}}, {"model": "api.category", "pk": 9, "fields": {"name": "Recreation Facility"}}, {"model": "api.category", "pk": 2, "fields": {"name": "Restaurant"}}, {"model": "api.category", "pk": 8, "fields": {"name": "Retail Store"}}, {"model": "api.category", "pk": 7, "fields": {"name": "Service"}}, {"model": "api.category", "pk": 11, "fields": {"name": "Student Center"}}, {"model": "api.category", "pk": 5, "fields": {"name": "Take Out Dining Hall"}}]
\ No newline at end of file
import json
print("HI")
with open('./openTimes.json') as f:
x = json.loads(f.read())
"""Yes, this file is totally unnecessary but I didn't have access to the dumpdata command so I did this."""
newList = list()
open_times = list()
for i in x:
nextSet = {
"pk": None,
"model": "api.OpenTime",
"fields": i
}
#{ "model":"api.category", "pk": i[1]["id"], "fields":{ "name": i[1]["name"] } }
newList.append(nextSet)
"""
#For schedules
cpy = dict(i)
open_times += list( i["open_times"] )
del( cpy["id"] )
del( cpy["open_times"] )
nextSet = {
"pk": i["id"],
"model": "api.schedule",
"fields": cpy
}
#{ "model":"api.category", "pk": i[1]["id"], "fields":{ "name": i[1]["name"] } }
newList.append(nextSet)
"""
"""
#for categories
nextSet = { "model":"api.category", "pk": i[1]["id"], "fields":{ "name": i[1]["name"] } }
#for buildings
"""
"""
#FOR LOCATION
coords = i["coordinate_location"]["coordinates"]
nextSet = {
"fields": {
"building": i["building"],
"friendly_building": i["friendly_building"],
"address": i["address"],
"campus_region": i["campus_region"],
"coordinate_location":"SRID=4326;POINT (" + str(coords[0]) + " " + str(coords[1]) + ")" ,"on_campus":i["on_campus"],
},
"model": "api.location",
"pk": i["id"] }
"""
with open("./fixtureOut.json", "w") as f:
json.dump(newList, f)
\ No newline at end of file
[{"fields": {"building": "Southside Dining Hall", "friendly_building": "", "address": "4353 Chesapeake River Way, Fairfax VA 22030", "campus_region": "fairfax", "coordinate_location": "SRID=4326;POINT (-77.3055097353121 38.83132949580784)", "on_campus": true}, "model": "api.location", "pk": 1}, {"fields": {"building": "Johnson Center", "friendly_building": "JC", "address": "4477 Aquia Creek Ln", "campus_region": "fairfax", "coordinate_location": "SRID=4326;POINT (-77.30743019696871 38.83002150186233)", "on_campus": true}, "model": "api.location", "pk": 2}, {"fields": {"building": "Merten Hall", "friendly_building": "", "address": "4441 George Mason Blvd", "campus_region": "fairfax", "coordinate_location": "SRID=4326;POINT (-77.30780302401908 38.83502768729392)", "on_campus": true}, "model": "api.location", "pk": 3}, {"fields": {"building": "Eisenhower Hall", "friendly_building": "", "address": "10445 Presidents Park Dr. Fairfax, VA 22030", "campus_region": "fairfax", "coordinate_location": "SRID=4326;POINT (-77.3023532246023 38.82887578842599)", "on_campus": true}, "model": "api.location", "pk": 4}, {"fields": {"building": "Mason Global Center", "friendly_building": "", "address": "4352 Mason Pond Dr. Fairfax VA, 22030", "campus_region": "fairfax", "coordinate_location": "SRID=4326;POINT (-77.31484918710255 38.82982300227717)", "on_campus": true}, "model": "api.location", "pk": 5}, {"fields": {"building": "Student Union Building 1", "friendly_building": "SUB 1", "address": "4469 Aquia Creek Ln", "campus_region": "fairfax", "coordinate_location": "SRID=4326;POINT (-77.30893491622413 38.83167634001074)", "on_campus": true}, "model": "api.location", "pk": 6}, {"fields": {"building": "Tidewater Hall", "friendly_building": "", "address": "4349B Chesapeake River Wy", "campus_region": "fairfax", "coordinate_location": "SRID=4326;POINT (-77.30605422374416 38.83191871206628)", "on_campus": true}, "model": "api.location", "pk": 7}, {"fields": {"building": "Recreation and Athletic Complex", "friendly_building": "", "address": "4350 Banister Creek Court Fairfax, VA 22030", "campus_region": "fairfax", "coordinate_location": "SRID=4326;POINT (-77.31242178794294 38.83214854687145)", "on_campus": true}, "model": "api.location", "pk": 8}, {"fields": {"building": "Blue Ridge Hall", "friendly_building": "", "address": "4343A Chesapeake River Wy Fairfax, VA 22030", "campus_region": "fairfax", "coordinate_location": "SRID=4326;POINT (-77.3066536974583 38.83283804683776)", "on_campus": true}, "model": "api.location", "pk": 9}, {"fields": {"building": "Long and Kimmy Nguyen Engineering Building", "friendly_building": "ENGR", "address": "4511 Patriot Circle Fairfax, VA 22030", "campus_region": "fairfax", "coordinate_location": "SRID=4326;POINT (-77.30482040759644 38.82726753188584)", "on_campus": true}, "model": "api.location", "pk": 10}, {"fields": {"building": "Northern Neck Hall", "friendly_building": "", "address": "4335 Chesapeake River Way Fairfax, VA 22030", "campus_region": "fairfax", "coordinate_location": "SRID=4326;POINT (-77.3071914803656 38.83378662072572)", "on_campus": true}, "model": "api.location", "pk": 11}, {"fields": {"building": "RAC", "friendly_building": "", "address": "4556 Patriot Circle Fairfax, VA 22030", "campus_region": "fairfax", "coordinate_location": "SRID=4326;POINT (-77.31177485615869 38.83039760482036)", "on_campus": true}, "model": "api.location", "pk": 12}, {"fields": {"building": "AFC", "friendly_building": "", "address": "4520 Patriot Circle Fairfax, VA 22030", "campus_region": "fairfax", "coordinate_location": "SRID=4326;POINT (-77.30433224555568 38.82680365088904)", "on_campus": true}, "model": "api.location", "pk": 13}, {"fields": {"building": "fhuak", "friendly_building": "", "address": "hdjkshajda", "campus_region": "fairfax", "coordinate_location": "SRID=4326;POINT (-75.70678709883241 37.63163475132333)", "on_campus": true}, "model": "api.location", "pk": 14}, {"fields": {"building": "Fenwick Library", "friendly_building": "", "address": "4348 Chesapeake River Wy", "campus_region": "fairfax", "coordinate_location": "SRID=4326;POINT (-77.30703577547085 38.83126070475519)", "on_campus": true}, "model": "api.location", "pk": 15}, {"fields": {"building": "Arlington Campus", "friendly_building": "", "address": "3401 Fairfax Drive", "campus_region": "arlington", "coordinate_location": "SRID=4326;POINT (-77.10249051585782 38.8824834408851)", "on_campus": true}, "model": "api.location", "pk": 16}, {"fields": {"building": "Rogers Hall", "friendly_building": "", "address": "4400 Aquia Creek Lane", "campus_region": "fairfax", "coordinate_location": "SRID=4326;POINT (-77.31074795274685 38.8344031381376)", "on_campus": true}, "model": "api.location", "pk": 17}, {"fields": {"building": "The Hub", "friendly_building": "Hub", "address": "4400 Rivanna River Way", "campus_region": "fairfax", "coordinate_location": "SRID=4326;POINT (-77.30473980455434 38.83062718736547)", "on_campus": true}, "model": "api.location", "pk": 18}, {"fields": {"building": "SciTech Campus", "friendly_building": "SciTech", "address": "10900 University Blvd", "campus_region": "prince william", "coordinate_location": "SRID=4326;POINT (-77.52155885245067 38.75655953545938)", "on_campus": true}, "model": "api.location", "pk": 19}, {"fields": {"building": "Exploratory Hall", "friendly_building": "EXPL", "address": "10431 Rivanna River Way", "campus_region": "fairfax", "coordinate_location": "SRID=4326;POINT (-77.30547472982231 38.82977249338438)", "on_campus": true}, "model": "api.location", "pk": 20}, {"fields": {"building": "Innovation Hall", "friendly_building": "INNO", "address": "4699 Mattaponi River Lane", "campus_region": "fairfax", "coordinate_location": "SRID=4326;POINT (-77.30760440378158 38.82843741102617)", "on_campus": true}, "model": "api.location", "pk": 21}, {"fields": {"building": "EagleBank Arena", "friendly_building": "", "address": "4500 Patriot Circle", "campus_region": "fairfax", "coordinate_location": "SRID=4326;POINT (-77.31027588395975 38.82683933353006)", "on_campus": true}, "model": "api.location", "pk": 22}, {"fields": {"building": "Arlington Campus", "friendly_building": "", "address": "3351 Fairfax Dr, MSN 5A7", "campus_region": "arlington", "coordinate_location": "SRID=4326;POINT (-77.10142836125345 38.8845588086479)", "on_campus": true}, "model": "api.location", "pk": 23}, {"fields": {"building": "SciTech Campus", "friendly_building": "", "address": "10900 George Mason Circle, MSN 1H6", "campus_region": "prince william", "coordinate_location": "SRID=4326;POINT (-77.52169832732059 38.75654531233209)", "on_campus": true}, "model": "api.location", "pk": 24}, {"fields": {"building": "Johnson Center", "friendly_building": "JC", "address": "4400 University Dr.", "campus_region": "fairfax", "coordinate_location": "SRID=4326;POINT (-77.30703577547085 38.82984823604826)", "on_campus": true}, "model": "api.location", "pk": 25}, {"fields": {"building": "Peterson Hall", "friendly_building": "", "address": "4408 Patriot Circle", "campus_region": "fairfax", "coordinate_location": "SRID=4326;POINT (-77.3091171696656 38.83435299401262)", "on_campus": true}, "model": "api.location", "pk": 26}, {"fields": {"building": "Front Royal", "friendly_building": "", "address": "1500 Remount Road, Front Royal, VA 22630", "campus_region": "front royal", "coordinate_location": "SRID=4326;POINT (-77.30142459421185 38.82389717254573)", "on_campus": true}, "model": "api.location", "pk": 27}, {"fields": {"building": "Skyline Fitness", "friendly_building": "", "address": "4651 Chesapeake River Way Fairfax, VA 22030", "campus_region": "fairfax", "coordinate_location": "SRID=4326;POINT (-77.3057965949058 38.83165351651481)", "on_campus": true}, "model": "api.location", "pk": 28}]
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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