def select_all():
    authors = []

    sql = "SELECT * FROM authors"
    results = run_sql(sql)

    for row in results:
        book = book_repository.select(row['book_id'])
        author = Author(row['first_name'], row['last_name'], row['id'])
        authors.append(author)
    return authors
Beispiel #2
0
def show_book(id):
    book = book_repository.select(id)
    return render_template("books/show.html", book=book)
Beispiel #3
0
def edit_book(id):
    book = book_repository.select(id)
    authors = author_repository.select_all()
    return render_template("books/edit.html", book=book, all_authors=authors)
def edit_book():
    authors = author_repository.select_all()
    book = book_repository.select(request.form['book_id'])
    return render_template("books/edit.html", book = book, authors = authors)
def show_book():
    book = book_repository.select(request.form['book_id'])
    return render_template("books/show.html", book = book)
def book(id):
    book = book_repository.select(id)
    return render_template('books/show.html', book=book)
def edit(id):
    book = book_repository.select(id)
    authors = author_repository.select_all()
    return render_template('books/edit.html', book=book, authors=authors)
Beispiel #8
0
def show_book(id):
    book = book_repository.select(id)
    return render_template('/books/show.html', selected_book=book)