-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathposts_data.py
More file actions
133 lines (131 loc) · 3.01 KB
/
posts_data.py
File metadata and controls
133 lines (131 loc) · 3.01 KB
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
from main import db
from main import Post
posts = [
{
"name": "IT Representative",
"max_votes" : 1,
"applied_hostel" : "all",
"help_text" : "Select only one IT Rep"
},
{
"name": "STEP Representative",
"max_votes" : 1,
"applied_hostel" : "all",
"help_text" : "lorem ipsum dolor set amit"
},
{
"name": "President",
"max_votes" : 1,
"applied_hostel" : "all",
"help_text" : "lorem ipsum dolor set amit"
},
{
"name": "Treasurer",
"max_votes" : 1,
"applied_hostel" : "all",
"help_text" : "lorem ipsum dolor set amit"
},
{
"name": "Library Representative",
"max_votes" : 1,
"applied_hostel" : "all",
"help_text" : "lorem ipsum dolor set amit"
},
{
"name": "Alumni Secretary",
"max_votes" : 1,
"applied_hostel" : "all",
"help_text" : "lorem ipsum dolor set amit"
},
{
"name": "Cultural Secretary",
"max_votes" : 1,
"applied_hostel" : "all",
"help_text" : "lorem ipsum dolor set amit"
},
{
"name": "Hostel Affairs Secretary",
"max_votes" : 1,
"applied_hostel" : "all",
"help_text" : "lorem ipsum dolor set amit"
},
{
"name": "Sports Secretary",
"max_votes" : 1,
"applied_hostel" : "all",
"help_text" : "lorem ipsum dolor set amit"
},
{
"name": "External Relations Secretary",
"max_votes" : 2,
"applied_hostel" : "all",
"help_text" : "Select 2 of these guys"
},
{
"name": "Placement Representative",
"max_votes" : 5,
"applied_hostel" : "all",
"help_text" : "Pick 5 of these guys"
},
{
"name": "PGP Representative",
"max_votes" : 4,
"applied_hostel" : "all",
"help_text" : "2 from PGDM, 1 from PGDCM, 1 from PGDM/PGDCM"
},
{
"name": "LVH Mess Representative",
"max_votes" : 1,
"applied_hostel" : "LVH",
"help_text" : "lorem ipsum dolor set amit"
},
{
"name": "LVH Hostel Representative",
"max_votes" : 1,
"applied_hostel" : "LVH",
"help_text" : "lorem ipsum dolor set amit"
},
{
"name": "OH Mess Representative",
"max_votes" : 1,
"applied_hostel" : "OH",
"help_text" : "lorem ipsum dolor set amit"
},
{
"name": "OH Hostel Representative",
"max_votes" : 1,
"applied_hostel" : "OH",
"help_text" : "lorem ipsum dolor set amit"
},
{
"name": "NH Mess Representative",
"max_votes" : 1,
"applied_hostel" : "NH",
"help_text" : "lorem ipsum dolor set amit"
},
{
"name": "NH Hostel Representative",
"max_votes" : 1,
"applied_hostel" : "NH",
"help_text" : "lorem ipsum dolor set amit"
},
{
"name": "WH Mess Representative",
"max_votes" : 1,
"applied_hostel" : "WH",
"help_text" : "lorem ipsum dolor set amit"
},
{
"name": "WH Hostel Representative",
"max_votes" : 1,
"applied_hostel" : "WH",
"help_text" : "lorem ipsum dolor set amit"
},
]
def add_posts_to_db():
db.drop_all()
db.create_all()
for post in posts:
db.session.add(Post(post["name"], post["max_votes"], post["applied_hostel"],
post["help_text"]))
db.session.commit()