Пример #1
0
def register():
    form = RegisterForm()
    if form.validate_on_submit():
        # register if ok
        add_user(form.user)
        return redirect(url_for('web.index'))
    return render_template('register.html', form=form)
Пример #2
0
def register():
    form = RegisterForm()
    if form.validate_on_submit():
        # register if ok
        add_user(form.user)
        return redirect(url_for('web.index'))
    return render_template('register.html', form=form)
Пример #3
0
def reset_all(json_file):
    db.drop_all()
    db.create_all()

    items = json.loads(open(json_file).read())
    for item in items['bookmarks']:
        i = ItemBookmark(**item)
        add_bookmark(i)
    for item in items['users']:
        i = User(**item)
        add_user(i)