Exemplo n.º 1
0
def create_country():
    if request.method == 'GET':
        return render_template('country/create.html')
    else:
        country = Country.create(name=request.form['name'], code=request.form['code'], status=request.form['status'])
        flash("Country has created", 'success')
        return redirect(url_for('.country_index'))
Exemplo n.º 2
0
def post(body):
    country_data = body
    country = Country.create(**country_data)

    return {'id': country.id}