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'))
def post(body): country_data = body country = Country.create(**country_data) return {'id': country.id}