예제 #1
0
def hello_world():
    v = Version()
    v.version = '0.4'
    v.latest = True
    db.session.add(v)
    db.session.commit()
    return v.version
예제 #2
0
def hello_world():
    v = Version()
    v.version = '0.4'
    v.latest = True
    db.session.add(v)
    db.session.commit()
    return v.version
예제 #3
0
def createdb():
    """ Creates a database with all of the tables defined in
        your SQLAlchemy models
    """

    db.create_all()

    # Version and User added manually at DB creation (this is used only for the skeleton example)
    v = Version()
    v.version = '0.1'
    v.latest = True
    db.session.add(v)
    u = User()
    u.name = 'Tiago Reichert'
    u.email = '*****@*****.**'
    db.session.add(u)
    u = User()
    u.name = 'Foo Bar'
    u.email = '*****@*****.**'
    db.session.add(u)
    db.session.commit()