def create_ninja(): data = { "dojo_id" : request.form["dojos"], "first_name" : request.form["first_name"], "last_name" : request.form["last_name"], "age" : request.form["age"] } Dojo.create_ninja(data) return redirect('/dojo/'+data['dojo_id'])
def results(): if not Dojo.validate_survey(request.form): return redirect('/') Dojo.save(request.form) data = { 'name' : request.form['name'], 'location' : request.form['location'], 'language' : request.form['language'], 'comments' : request.form['comments'] } return render_template("results.html", data = data)
def show_dojo_ninjas(id): return render_template("dojo_ninjas.html", dojo=Dojo.get(id), ninjas=Ninja.get_all_from_dojo(id))
def dojos_index(): return render_template('dojos_main.html', all_dojos=Dojo.get_all())
def display_ninjas_this_dojo(dojo_id): data = {"dojo_id": dojo_id} return render_template('display_ninjas_this_dojo.html', dojo=Dojo.get_by_id(data), all_ninjas=Ninja.get_ninjas_by_dojo_id(data))
def new(): return render_template("index_add.html", all_dojos=Dojo.all_dojos())
def add_dojo(): Dojo.add(request.form) return redirect("/dojos")
def homepage(): dojos = Dojo.get_all() return render_template('index.html', dojos=dojos)
def create_dojo(): user_input = request.form Dojo.create_dojo(user_input) return redirect('/')
def show_dojo(id): data = { "id" : id } return render_template('ninjas.html', ninjas = Dojo.get_ninja(data), dojo = Dojo.get_dojo(data))
def create_dojo(): data = { "name" : request.form['name'] } Dojo.create_dojo(data) return redirect('/')
def index(): return render_template("index.html", all_dojos=Dojo.show_all())
def display_dojo(dojo_id): return render_template("dojo_members.html", dojo=Dojo.display_dojo({"id": dojo_id}))
def new_dojo(): Dojo.new_dojo(request.form) return render_template("index.html", all_dojos=Dojo.show_all())
def new_ninja(): return render_template("create_ninja.html", dojos=Dojo.get_all())
def add_dojo(): data = {"name": request.form["dojo_name"]} Dojo.add(data) return redirect("/dojos")
def home_page(): return render_template("index.html", dojos=Dojo.get_all())
def add_ninja(): return render_template('add_ninja.html', dojos = Dojo.get_all_dojos())
def show_one_dojo(id): dojo = Dojo.get_one(id) ninjas = Ninja.get_all_by_dojo(id) return render_template('ninjas.html', dojo=dojo, ninjas=ninjas)
def dojo_main(): return render_template('index.html', dojos = Dojo.get_all_dojos())
def new_ninja(): return render_template("new_ninja.html", all_dojos=Dojo.show_all())
def add_dojo_to_db(): new_dojo_id = Dojo.insert_new_dojo(request.form) return redirect("/dojos")
def show_dojo(id): data = {'id': int(id)} return render_template("index_show.html", dojo=Dojo.get_ninja_by_dojo(data))
def ninjas_index(): return render_template('add_ninja.html', all_dojos=Dojo.get_all())