-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstudent_data.py
47 lines (45 loc) · 1.74 KB
/
student_data.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
from manager.models import Student
students_data = [
{
"name": "3035772432",
"usrname": "Zhiheng Lyu",
"email": "[email protected]",
"bio": "Zhiheng Lyu, a computer science enthusiast, is known for his passion for artificial intelligence and its applications in solving real-world problems."
},
{
"name": "3035835595",
"usrname": "Yujing Wang",
"email": "[email protected]",
"bio": "Yujing Wang, an aspiring software developer, has a keen interest in developing user-friendly applications that make daily tasks more efficient."
},
{
"name": "3035856044",
"usrname": "Haoyu Sun",
"email": "[email protected]",
"bio": "Haoyu Sun, with a strong foundation in mathematics, excels in creating algorithms that optimize data processing and analysis."
},
{
"name": "3035844077",
"usrname": "Maodian Huang",
"email": "[email protected]",
"bio": "Maodian Huang is passionate about web development, focusing on building responsive and accessible websites for diverse audiences."
},
{
"name": "3035780922",
"usrname": "Nanqi Gong",
"email": "[email protected]",
"bio": "Nanqi Gong has a strong interest in network security, dedicating his studies to understanding and mitigating cyber threats."
}
]
def load_data(dat):
from manager.models import Student
for student in dat:
obj, created = Student.objects.get_or_create (
name = student["name"],
usrname = student["usrname"],
email = student["email"],
bio = student["bio"]
)
if not created:
break
load_data(students_data)