mirror of
https://github.com/Doctorado-ML/beflask.git
synced 2025-08-16 07:35:51 +00:00
Begin with model
This commit is contained in:
26
dbseed.py
Normal file
26
dbseed.py
Normal file
@@ -0,0 +1,26 @@
|
||||
from app.models import Benchmark, db, User
|
||||
from app import app
|
||||
|
||||
app = app.create_app()
|
||||
|
||||
with app.app_context():
|
||||
db.drop_all()
|
||||
db.create_all()
|
||||
b = Benchmark(
|
||||
name="discretizbench",
|
||||
folder="proyects/discretizbench",
|
||||
description="Experiments with local discretization and Bayesian classifiers",
|
||||
)
|
||||
u = User(username="rmontanana", email="rmontanana@gmail.com", admin=True)
|
||||
u.set_password("patata")
|
||||
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()
|
Reference in New Issue
Block a user