Пример #1
0
def models(config_path):
    """ Setup the sqlite db and initialize the models """
    autograder.setup_app(config_path)

    # Now that setup has occurred, we can import the models
    from autograder import models as m

    # Make sure that if we've used a different db setup in another module
    # we don't keep trying to write to that database
    m.db.session.remove()

    m.drop_all()
    m.create_all()
    return m
Пример #2
0
def setup_db(recreate):
    from autograder import models as m
    if recreate:
        m.drop_all()
    m.create_all()