Exemple #1
0
def seed():
    # os.remove('.db')
    # shutil.rmtree('migrations')
    with app.app_context():
        init()
        migrate()
        upgrade()

        Room.add(name="test", password="")
Exemple #2
0
def addroom(name, password, description):
    if name is "":
        print("Error: Name is empty")
        return

    if password is "":
        print("Warning: Password is empty")

    with app.app_context():
        if Room.exists(name):
            print("Error: Room {} already exists".format(name))
            return

        Room.add(name=name, password=password, description=description)
        print("Success: Room {} added".format(name))