Beispiel #1
0
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'])
Beispiel #2
0
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)
Beispiel #3
0
def show_dojo_ninjas(id):
    return render_template("dojo_ninjas.html",
                           dojo=Dojo.get(id),
                           ninjas=Ninja.get_all_from_dojo(id))
Beispiel #4
0
def dojos_index():
    return render_template('dojos_main.html', all_dojos=Dojo.get_all())
Beispiel #5
0
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))
Beispiel #6
0
def new():

    return render_template("index_add.html", all_dojos=Dojo.all_dojos())
Beispiel #7
0
def add_dojo():
    Dojo.add(request.form)
    return redirect("/dojos")
Beispiel #8
0
def homepage():
    dojos = Dojo.get_all()
    return render_template('index.html', dojos=dojos)
Beispiel #9
0
def create_dojo():
    user_input = request.form
    Dojo.create_dojo(user_input)
    return redirect('/')
Beispiel #10
0
def show_dojo(id):
    data = {
        "id" : id
    }
    
    return render_template('ninjas.html', ninjas = Dojo.get_ninja(data), dojo = Dojo.get_dojo(data))
Beispiel #11
0
def create_dojo():
    data = {
        "name" : request.form['name']
    }
    Dojo.create_dojo(data)
    return redirect('/')
Beispiel #12
0
def index():
    return render_template("index.html", all_dojos=Dojo.show_all())
Beispiel #13
0
def display_dojo(dojo_id):
    return render_template("dojo_members.html",
                           dojo=Dojo.display_dojo({"id": dojo_id}))
Beispiel #14
0
def new_dojo():
    Dojo.new_dojo(request.form)
    return render_template("index.html", all_dojos=Dojo.show_all())
Beispiel #15
0
def new_ninja():
    return render_template("create_ninja.html", dojos=Dojo.get_all())
Beispiel #16
0
def add_dojo():
    data = {"name": request.form["dojo_name"]}
    Dojo.add(data)
    return redirect("/dojos")
Beispiel #17
0
def home_page():
    return render_template("index.html", dojos=Dojo.get_all())
Beispiel #18
0
def add_ninja():

    return render_template('add_ninja.html', dojos = Dojo.get_all_dojos())
Beispiel #19
0
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)
Beispiel #20
0
def dojo_main():

    return render_template('index.html', dojos = Dojo.get_all_dojos())
Beispiel #21
0
def new_ninja():
    return render_template("new_ninja.html", all_dojos=Dojo.show_all())
Beispiel #22
0
def add_dojo_to_db():
    new_dojo_id = Dojo.insert_new_dojo(request.form)
    return redirect("/dojos")
Beispiel #23
0
def show_dojo(id):
    data = {'id': int(id)}
    return render_template("index_show.html",
                           dojo=Dojo.get_ninja_by_dojo(data))
Beispiel #24
0
def ninjas_index():
    return render_template('add_ninja.html', all_dojos=Dojo.get_all())