def uwp_team(): dsn = app.config['dsn'] page = UWP(dsn) if request.method == 'GET': return page.show_page_team() elif 'Add' in request.form: country = request.form['Country'] if country: return page.add_team(country) else: flash("You need to enter a country name!") return page.show_page_team() elif 'Delete' in request.form: id = request.form.get('select', '') if id: return page.delete_team(id) else: flash("You need to select the team you want to delete using the radio buttons!") return page.show_page_team() elif 'Update' in request.form: id = request.form.get('select', '') country = request.form['Country'] if country and id: return page.update_team(country, id) else: if not id: flash("You need to select the team you want to update using the radio buttons!") if not country: flash("You need to enter a country name!") return page.show_page_team()
def uwp_team(): dsn = app.config['dsn'] page = UWP(dsn) if request.method == 'GET': return page.show_page_team() elif 'Add' in request.form: country = request.form['Country'] if country: return page.add_team(country) else: flash("You need to enter a country name!") return page.show_page_team() elif 'Delete' in request.form: id = request.form.get('select', '') if id: return page.delete_team(id) else: flash( "You need to select the team you want to delete using the radio buttons!" ) return page.show_page_team() elif 'Update' in request.form: id = request.form.get('select', '') country = request.form['Country'] if country and id: return page.update_team(country, id) else: if not id: flash( "You need to select the team you want to update using the radio buttons!" ) if not country: flash("You need to enter a country name!") return page.show_page_team()