Exemplo n.º 1
0
def update_activity(id):
    name = request.form['name']
    date = request.form['date']
    time = request.form['time']
    capacity = request.form['capacity']
    trainer = trainer_repository.select(request.form['trainer_id'])
    activity = Activity(name, date, time, trainer, capacity, id)
    activity_repository.update(activity)
    return redirect("/activities")
def update_activity(id):
    activity_type = request.form['activity_type']
    duration = request.form['duration']
    difficulty = request.form['difficulty']
    gym_id = request.form['gym']
    gym = gym_repository.select(gym_id)
    activity = Activity(gym, activity_type, duration, difficulty, id)
    activity_repository.update(activity)
    return redirect("/all-activities")
Exemplo n.º 3
0
def update_activity(id):
    name = request.form["name"]
    venue = request.form["venue"]
    category = request.form["category"]
    capacity = request.form["capacity"]
    finished = request.form["finished"]
    offpeak = request.form["offpeak"]
    activity = Activity(name, venue, category, capacity, finished, offpeak, id)
    activity_repository.update(activity)
    return redirect("/activities")
Exemplo n.º 4
0
def update_activity(id):
    name = request.form["name"]
    # upcoming = request.form["upcoming"]
    try:
        upcoming = request.form["upcoming"]
    except:
        upcoming = False

    activity = Activity(name, upcoming, id)
    activity_repository.update(activity)
    return redirect('/activities')
Exemplo n.º 5
0
def update_activity(id):
    name = request.form["name"]
    photo = request.files["photo"].filename

    if photo == '':
        activity = activity_repository.select(id)
        photo = activity.photo

    trainer = request.form["trainer"]

    activity = Activity(name, photo, trainer, id)
    activity_repository.update(activity)
    return redirect("/activities")