mirror of
https://github.com/AmanTahiliani/PeerNotes.git
synced 2026-08-07 11:55:12 -04:00
Added Initial Data
This commit is contained in:
38
backend/api/migrations/0009_add_course_data.py
Normal file
38
backend/api/migrations/0009_add_course_data.py
Normal file
@@ -0,0 +1,38 @@
|
||||
# Generated by Django 4.2.11 on 2024-04-21 03:17
|
||||
|
||||
from django.db import migrations
|
||||
import os
|
||||
|
||||
import json
|
||||
|
||||
|
||||
def load_data_from_json(apps, schema_editor):
|
||||
Course = apps.get_model("api", "Course")
|
||||
json_file = os.path.abspath(
|
||||
os.path.join(
|
||||
os.path.dirname(__file__), "..", "utils", "JSON_inputs", "courses.json"
|
||||
)
|
||||
)
|
||||
|
||||
with open(json_file, "r") as f:
|
||||
data = json.load(f)
|
||||
|
||||
for item in data:
|
||||
try:
|
||||
Course.objects.create(
|
||||
name=item["name"],
|
||||
number=item["number"],
|
||||
)
|
||||
except Exception as e:
|
||||
print("Error:", str(e))
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("api", "0008_userreport"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RunPython(load_data_from_json),
|
||||
]
|
||||
37
backend/api/migrations/0010_add_professors.py
Normal file
37
backend/api/migrations/0010_add_professors.py
Normal file
@@ -0,0 +1,37 @@
|
||||
# Generated by Django 4.2.11 on 2024-04-21 04:01
|
||||
|
||||
from django.db import migrations
|
||||
import os
|
||||
|
||||
import json
|
||||
|
||||
|
||||
def load_data_from_json(apps, schema_editor):
|
||||
Professor = apps.get_model("api", "Professor")
|
||||
json_file = os.path.abspath(
|
||||
os.path.join(
|
||||
os.path.dirname(__file__), "..", "utils", "JSON_inputs", "faculty_list.json"
|
||||
)
|
||||
)
|
||||
|
||||
with open(json_file, "r") as f:
|
||||
data = json.load(f)
|
||||
|
||||
for item in data:
|
||||
try:
|
||||
Professor.objects.create(
|
||||
name=item["name"],
|
||||
)
|
||||
except Exception as e:
|
||||
print("Error:", str(e))
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("api", "0009_add_course_data"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RunPython(load_data_from_json),
|
||||
]
|
||||
27
backend/api/migrations/0011_auto_20240421_0406.py
Normal file
27
backend/api/migrations/0011_auto_20240421_0406.py
Normal file
@@ -0,0 +1,27 @@
|
||||
from django.db import migrations
|
||||
import os
|
||||
|
||||
import json
|
||||
|
||||
|
||||
def load_data_from_json(apps, schema_editor):
|
||||
Semester = apps.get_model("api", "Semester")
|
||||
Semester.objects.all().delete()
|
||||
for year in range(2015, 2024):
|
||||
for sem in ["Spring", "Summer", "Fall"]:
|
||||
try:
|
||||
Semester.objects.create(
|
||||
name=f"{sem} {year}",
|
||||
)
|
||||
except Exception as e:
|
||||
print("Error:", str(e))
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("api", "0010_add_professors"),
|
||||
]
|
||||
operations = [
|
||||
migrations.RunPython(load_data_from_json),
|
||||
]
|
||||
1522
backend/api/utils/JSON_inputs/courses.json
Normal file
1522
backend/api/utils/JSON_inputs/courses.json
Normal file
File diff suppressed because it is too large
Load Diff
245
backend/api/utils/JSON_inputs/faculty_list.json
Normal file
245
backend/api/utils/JSON_inputs/faculty_list.json
Normal file
@@ -0,0 +1,245 @@
|
||||
[
|
||||
{
|
||||
"name": "Jacob Abernethy"
|
||||
},
|
||||
{
|
||||
"name": "Mustaque Ahamad"
|
||||
},
|
||||
{
|
||||
"name": "Mostafa Ammar"
|
||||
},
|
||||
{
|
||||
"name": "Joy Arulraj"
|
||||
},
|
||||
{
|
||||
"name": "Ramin Ayanzadeh"
|
||||
},
|
||||
{
|
||||
"name": "Suguman Bansal"
|
||||
},
|
||||
{
|
||||
"name": "Ketan Bhardwaj"
|
||||
},
|
||||
{
|
||||
"name": "Douglas Blough"
|
||||
},
|
||||
{
|
||||
"name": "Gregory Bodwin"
|
||||
},
|
||||
{
|
||||
"name": "Alexandra Boldyreva"
|
||||
},
|
||||
{
|
||||
"name": "Xu Chu"
|
||||
},
|
||||
{
|
||||
"name": "Pak Ho (Simon) Chung"
|
||||
},
|
||||
{
|
||||
"name": "Russell Clark"
|
||||
},
|
||||
{
|
||||
"name": "Thomas Conte"
|
||||
},
|
||||
{
|
||||
"name": "Tom Conte"
|
||||
},
|
||||
{
|
||||
"name": "Rachel Cummings"
|
||||
},
|
||||
{
|
||||
"name": "Alexandros Daglis"
|
||||
},
|
||||
{
|
||||
"name": "Alberto Dainotti"
|
||||
},
|
||||
{
|
||||
"name": "Richard DeMillo"
|
||||
},
|
||||
{
|
||||
"name": "David Devecsery"
|
||||
},
|
||||
{
|
||||
"name": "Ashutosh Dhekne"
|
||||
},
|
||||
{
|
||||
"name": "Constantine Dovrolis"
|
||||
},
|
||||
{
|
||||
"name": "Alex Duncan"
|
||||
},
|
||||
{
|
||||
"name": "Greg Eisenhauer"
|
||||
},
|
||||
{
|
||||
"name": "Merrick Furst"
|
||||
},
|
||||
{
|
||||
"name": "Zvi Galil"
|
||||
},
|
||||
{
|
||||
"name": "Vijay Ganesh"
|
||||
},
|
||||
{
|
||||
"name": "Ada Gavrilovska"
|
||||
},
|
||||
{
|
||||
"name": "Daniel Genkin"
|
||||
},
|
||||
{
|
||||
"name": "Max Grossman"
|
||||
},
|
||||
{
|
||||
"name": "Swati Gupta"
|
||||
},
|
||||
{
|
||||
"name": "Akihiro Hayashi"
|
||||
},
|
||||
{
|
||||
"name": "Anand Padmanabha Iyer"
|
||||
},
|
||||
{
|
||||
"name": "Anand Padmanabha Iyer"
|
||||
},
|
||||
{
|
||||
"name": "ChulWon Kang"
|
||||
},
|
||||
{
|
||||
"name": "Hyesoon Kim"
|
||||
},
|
||||
{
|
||||
"name": "Taesoo Kim"
|
||||
},
|
||||
{
|
||||
"name": "Scott Klasky"
|
||||
},
|
||||
{
|
||||
"name": "Vladimir Kolesnikov"
|
||||
},
|
||||
{
|
||||
"name": "Maria Konte"
|
||||
},
|
||||
{
|
||||
"name": "Kevin Koo"
|
||||
},
|
||||
{
|
||||
"name": "Tushar Krishna"
|
||||
},
|
||||
{
|
||||
"name": "Wenke Lee"
|
||||
},
|
||||
{
|
||||
"name": "Yingyan (Celine) Lin"
|
||||
},
|
||||
{
|
||||
"name": "Ling Liu"
|
||||
},
|
||||
{
|
||||
"name": "Divya Mahajan"
|
||||
},
|
||||
{
|
||||
"name": "Yisreol Mirsky"
|
||||
},
|
||||
{
|
||||
"name": "Vincent Mooney"
|
||||
},
|
||||
{
|
||||
"name": "Shamkant Navathe"
|
||||
},
|
||||
{
|
||||
"name": "Alessandro Orso"
|
||||
},
|
||||
{
|
||||
"name": "Santosh Pande"
|
||||
},
|
||||
{
|
||||
"name": "Sunjae Park"
|
||||
},
|
||||
{
|
||||
"name": "Sunjae Park"
|
||||
},
|
||||
{
|
||||
"name": "Sri Raj Paul"
|
||||
},
|
||||
{
|
||||
"name": "Paul Pearce"
|
||||
},
|
||||
{
|
||||
"name": "Richard Peng"
|
||||
},
|
||||
{
|
||||
"name": "Roberto Perdisci"
|
||||
},
|
||||
{
|
||||
"name": "Will Perkins"
|
||||
},
|
||||
{
|
||||
"name": "Milos Prvulovic"
|
||||
},
|
||||
{
|
||||
"name": "Calton Pu"
|
||||
},
|
||||
{
|
||||
"name": "Moinuddin Qureshi"
|
||||
},
|
||||
{
|
||||
"name": "Umakishore Ramachandran"
|
||||
},
|
||||
{
|
||||
"name": "Dana Randall"
|
||||
},
|
||||
{
|
||||
"name": "Kexin Rong"
|
||||
},
|
||||
{
|
||||
"name": "Ahmed Saeed"
|
||||
},
|
||||
{
|
||||
"name": "Vivek Sarkar"
|
||||
},
|
||||
{
|
||||
"name": "Jun Shirako"
|
||||
},
|
||||
{
|
||||
"name": "Sahil Singla"
|
||||
},
|
||||
{
|
||||
"name": "Michael Specter"
|
||||
},
|
||||
{
|
||||
"name": "Cecilia Testart"
|
||||
},
|
||||
{
|
||||
"name": "Prasad Tetali"
|
||||
},
|
||||
{
|
||||
"name": "Alexey Tumanov"
|
||||
},
|
||||
{
|
||||
"name": "Jan van den Brand"
|
||||
},
|
||||
{
|
||||
"name": "Santosh Vempala"
|
||||
},
|
||||
{
|
||||
"name": "Qi Xin"
|
||||
},
|
||||
{
|
||||
"name": "Jun Xu"
|
||||
},
|
||||
{
|
||||
"name": "Guangliang Yang"
|
||||
},
|
||||
{
|
||||
"name": "Jeffrey Young"
|
||||
},
|
||||
{
|
||||
"name": "Ellen Zegura"
|
||||
},
|
||||
{
|
||||
"name": "Qirun Zhang"
|
||||
},
|
||||
{
|
||||
"name": "Jisheng Zhao"
|
||||
}
|
||||
]
|
||||
Reference in New Issue
Block a user