Exemplo n.º 1
0
def fill_db(config):
    set_config(config)
    from recastfrontend.server import app
    with app.app_context():
        from recastfrontend.server import db
        populate_db.populate_db(db)
        click.secho('filled database at: {}'.format(db.engine.url), fg='green')
Exemplo n.º 2
0
def drop_db(config):
    set_config(config)
    from recastfrontend.server import app
    with app.app_context():
        from recastfrontend.server import db
        db.drop_all()
        click.secho('dropped all at {}'.format(db.engine.url), fg = 'green')
Exemplo n.º 3
0
def create_db(config):
    set_config(config)
    from recastfrontend.server import app
    with app.app_context():
        from recastfrontend.server import db
        db.create_all()
        click.secho('created database at: {}'.format(db.engine.url), fg = 'green')
Exemplo n.º 4
0
def create_db(config):
  if config:
    os.environ['RECASTCONTROLCENTER_CONFIG'] = config
  from recastfrontend.server import app
  with app.app_context():
    from recastfrontend.server import db
    db.create_all()
    click.secho('created database at: {}'.format(db.engine.url), fg = 'green')
Exemplo n.º 5
0
def dbshell(config):
    set_config(config)
    from recastfrontend.server import app
    with app.app_context():
        from recastfrontend.server import db
        import recastdb.models as models
        print "models and db modules are available"
        IPython.embed()
Exemplo n.º 6
0
def dbshell(config):
  if config:
    os.environ['RECASTCONTROLCENTER_CONFIG'] = config
  from recastfrontend.server import app
  with app.app_context():
    from recastfrontend.server import db
    import recastdb.models as models
    print "models and db modules are available"
    IPython.embed()
Exemplo n.º 7
0
# -*- coding: utf-8 -*-
import recastdb.models as models
from flask import Flask
from frontendconfig import config as frontendconf
import uuid


from recastfrontend.server import app
with app.app_context():
    from recastfrontend.server import db
    db.create_all()

app.app_context().push()

user1 = models.User(
    name='Christian Bora',
    email='*****@*****.**'
    )
db.session.add(user1)
db.session.commit()


user2 = models.User(
    name='Admin',
    email='admin@recast',
    orcid_id = 'example123'
    )
db.session.add(user2)
db.session.commit()

token = models.AccessToken(