-
Notifications
You must be signed in to change notification settings - Fork 0
/
dbseed.py
45 lines (43 loc) · 1.14 KB
/
dbseed.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
from beflask.models import Benchmark, db, User
from beflask import app
app = app.create_app()
with app.app_context():
db.drop_all()
db.create_all()
b = Benchmark(
name="discretizbench",
folder="/home/rmontanana/Code/discretizbench",
description="Experiments with local discretization and Bayesian "
"classifiers",
)
db.session.add(b)
b = Benchmark(
name="odtebench",
folder="/home/rmontanana/Code/odtebench",
description="Experiments with STree and Ensemble classifiers",
)
db.session.add(b)
b = Benchmark(
name="covbench",
folder="/home/rmontanana/Code/covbench",
description="Experiments with COVID-19 dataset",
)
db.session.add(b)
u = User(
username="rmontanana",
email="rmontanana@gmail.com",
admin=True,
benchmark_id=1,
)
u.set_password("galeote")
u1 = User(
username="guest",
email="guest@example.com",
admin=False,
benchmark_id=1,
)
u1.set_password("guest")
db.session.add(b)
db.session.add(u)
db.session.add(u1)
db.session.commit()