-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsample_config.py
51 lines (44 loc) · 1.12 KB
/
sample_config.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
48
49
50
51
def create(db):
for function_name, function in list(globals().items()):
if callable(function) and function_name.startswith('create_'):
function(db)
def create_topics(db):
from main.models.topic import TopicModel
db.session.add(
TopicModel(
name='Math',
)
)
db.session.add(
TopicModel(
name='English',
)
)
db.session.commit()
def create_subscription_package(db):
from main.models.subscription_package import SubscriptionPackageModel
db.session.add(
SubscriptionPackageModel(
name='Bundle Package',
type='bundle',
price=36,
number_of_questions=3
)
)
db.session.add(
SubscriptionPackageModel(
name='Monthly Subscription',
type='monthly',
price=150,
number_of_questions=0
)
)
db.session.add(
SubscriptionPackageModel(
name='Yearly Subscription',
type='yearly',
price=960,
number_of_questions=0
)
)
db.session.commit()