Exemplo n.º 1
0
 def create_account(email="*****@*****.**"):
     account = Account()
     account.email = email
     account.default_subscription_price = 12500
     account.first_name = "Bob"
     account.last_name = "Aol.com"
     account.save()
     return account
Exemplo n.º 2
0
def do_create_account():
    form = AccountForm(request.form)
    account = Account()
    form.populate_obj(account)

    if form.validate_on_submit():
        account.save()
        return redirect(url_for("app_blueprint.show_accounts"))

    return render_template("account.html", form=form), 400