Ejemplo n.º 1
0
def new_entry():
    countries = country_repository.select_all()
    destinations = destination_repository.select_all()

    return render_template('search.html',
                           title="Home",
                           countries=countries,
                           destinations=destinations)
Ejemplo n.º 2
0
def create_destination_from_id(country_id):
    country = country_repository.select(country_id)
    destination = destination_repository.select_all()
    # destination_name = request.form['destination']
    # country = destination_repository.select(destination.country.id)
    # visited = request.form['visited']
    # destination = Destination(destination_name, country, visited)
    # destination_repository.save(destination)
    return render_template('destination/index.html',
                           country=country,
                           destinations=destination)
Ejemplo n.º 3
0
import pdb
from models.country import Country
from models.destination import Destination

import repositories.country_repository as country_repository
import repositories.destination_repository as destination_repository


country_repository.delete_all()
destination_repository.delete_all()

country_repository.select_all()
destination_repository.select_all()

country1 = Country('Brazil', '212 million', True)
country_repository.save(country1)

country2 = Country('Australia', '25 million', False)
country_repository.save(country2)


destination_1 = Destination('Foz do Iguacu', country1)
destination_repository.save(destination_1)

destination_2 = Destination('Sydney', country2)
destination_repository.save(destination_2)


pdb.set_trace()
Ejemplo n.º 4
0
def destinations():
    bucketlists = bucketlist_repository.select_all()
    countries = country_repository.select_all()
    destinations = destination_repository.select_all()
    return render_template("bucketlist/index.html", countries=countries, destinations=destinations, bucketlists=bucketlists)
Ejemplo n.º 5
0
def show_destinations():
    destinations = destination_repository.select_all()
    return render_template("destinations/index.html",
                           destinations=destinations)