Esempio n. 1
0
def index():
    form = contentForm()
    dataBaseManager = DataBaseManager()
    if form.validate_on_submit():
        innerCommand = form.commandInConfig.data
        writeCommand = form.commandInWrite.data

        if not (innerCommand or writeCommand):
            errorinfo = u'内置命令和自定义代码至少要写一个!'
            return render_template('index.html', form=form, errorinfo=errorinfo)
        else:
            info = {'innerCommand': innerCommand, 'writeCommand': writeCommand, 'run': False}
            dataBaseManager.insert(info)
        return redirect('/')
    return render_template('index.html', form=form, errorinfo='')
Esempio n. 2
0
def index():
    form = contentForm()
    dataBaseManager = DataBaseManager()

    if form.validate_on_submit():

        innerCommand = form.commandInConfig.data
        writeCommand = form.commandInWrite.data
        userName = form.userName.data
        password = form.password.data
        info = {'innerCommand': innerCommand, 'writeCommand': writeCommand,
                'userName': userName, 'password': password}
        dataBaseManager.insert(info)
        return redirect('/')
    return render_template('index.html', form=form)
Esempio n. 3
0
def index():
    form = contentForm()
    dataBaseManager = DataBaseManager()

    if form.validate_on_submit():

        innerCommand = form.commandInConfig.data
        writeCommand = form.commandInWrite.data
        userName = form.userName.data
        password = form.password.data
        info = {
            'innerCommand': innerCommand,
            'writeCommand': writeCommand,
            'userName': userName,
            'password': password
        }
        dataBaseManager.insert(info)
        return redirect('/')
    return render_template('index.html', form=form)
Esempio n. 4
0
def index():
    form = contentForm()
    dataBaseManager = DataBaseManager()
    if form.validate_on_submit():
        innerCommand = form.commandInConfig.data
        writeCommand = form.commandInWrite.data

        if not (innerCommand or writeCommand):
            errorinfo = u'内置命令和自定义代码至少要写一个!'
            return render_template('index.html',
                                   form=form,
                                   errorinfo=errorinfo)
        else:
            info = {
                'innerCommand': innerCommand,
                'writeCommand': writeCommand,
                'run': False
            }
            dataBaseManager.insert(info)
        return redirect('/')
    return render_template('index.html', form=form, errorinfo='')