def update_city(id): city_name = request.form["city_name"] date_of_travel = request.form["date_of_travel"] visited = request.form["visited"] city = City(city_name, date_of_travel, visited, id) city_repository.update(city) return redirect("/cities")
def update_city(id): city = city_repository.select(id) country = country_repository.select_all() visited = request.form['visited'] city = City(city.city_name, country, visited, id) city_repository.update(city) return redirect('/countries')
def update_city(id): name = request.form['name'] country_id = request.form['country_id'] visited = request.form['visited'] country = country_repository.select(country_id) city = City(name, country, visited, id) city_repository.update(city) return redirect('/list-destinations')
def update_city(id): name = request.form["name"] country_id = request.form["country_id"] visited = request.form["visited"] country = country_repository.select(country_id) city = City(name, country, visited, id) city_repository.update(city) return redirect("/cities")
def update_city(id): name = request.form["name"] city_type = request.form["city_type"] visited = request.form["visited"] country = country_repository.select(request.form["country_id"]) city = City(name, city_type, country, id, visited) city_repository.update(city) return redirect('/bucketlist')
def comment(id): city = city_repository.select(id) city_id = city.id name = city.name country = city.country visited = city.visited comment = request.form['comment'] commented_city = City(name, country, visited, comment, id) city_repository.update(commented_city) return redirect(f"/cities/{city_id}")
def update_city(id): name = request.form['name'] city = city_repository.select(id) city_id = city.id country_id = city.country.id country = country_repository.select(country_id) visited = city.visited comment = city.comment updated_city = City(name, country, visited, comment, id) city_repository.update(updated_city) return redirect(f"/cities/{city_id}")
def visit(id): city = city_repository.select(id) city_id = city.id name = city.name country = city.country comment = city.comment visited = True visit_city = City(name, country, visited, comment, id) city_repository.update(visit_city) visit_city.country.visited = True country_repository.update(visit_city.country) return redirect(f"/cities/{city_id}")
def visit(id): sight = sight_repository.select(id) sight_id = sight.id name = sight.name city = sight.city comment = sight.comment visited = True visit_sight = Sight(name, city, visited, comment, id) sight_repository.update(visit_sight) visit_sight.city.visited = True city_repository.update(visit_sight.city) visit_sight.city.country.visited = True country_repository.update(visit_sight.city.country) return redirect(f"/sights/{sight_id}")
def mark_city(id, id2): city = cities_repository.select(id2) city.mark_visited() cities_repository.update(city) return redirect("/countries/"+id)