Ejemplo n.º 1
0
def initialize(config):
    config_app(app, config)
    from dessert.models import *
    print "Drop all tables"
    db.drop_all()

    print "Create all tables"
    db.create_all()
Ejemplo n.º 2
0
def privilege(config, email, privilege):
    config_app(app, config)

    from daimaduan.models import User

    user = User.objects(email=email).first()
    if not user:
        print "User can not be found."
    else:
        user.privilege.privilege = int(privilege)
        user.save()
        print "Modification successed."
Ejemplo n.º 3
0
def test(config):
    config_app(app, config)
    dispatch_handlers(app)
    dispatch_apps(app)
    app.run(host='0.0.0.0')