class EditStateForm(FlaskForm): id = TextField("Id", [validators.Required("Please enter id of state.")]) name = TextField("Name", [validators.Required("Please enter state name.")]) country = SelectField("Country", choices=[(data['id'], data['name']) for data in Country.list()]) country_id = TextField( "Country Id", [validators.Required("Please enter id of country.")])
def get_country(): country_data = Country.list() if len(country_data) > 0: return jsonify({"country": country_data}), 200 else: return jsonify({ "error": True, "message": "No data present for countries" }), 200
def country(): return render_template("crud/country/list.html", countries=Country.list())