From 1edf5082c715e57fe0b0ef382444c736411461c1 Mon Sep 17 00:00:00 2001 From: Damien De Paoli Date: Sat, 21 Nov 2020 17:57:06 +1100 Subject: [PATCH] added publisher list in, so publisher in book.html is about done --- main.py | 9 +++++---- templates/book.html | 13 +++++++++++-- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/main.py b/main.py index 41a8ded..d23eb1e 100644 --- a/main.py +++ b/main.py @@ -16,8 +16,8 @@ ma = Marshmallow(app) Bootstrap(app) from author import Author, AuthorForm, AuthorSchema -from publisher import Publisher, PublisherForm, PublisherSchema -from genre import Genre, GenreForm, GenreSchema, GetGenreList +from publisher import Publisher, PublisherForm, PublisherSchema, GetPublishers +from genre import Genre, GenreForm, GenreSchema, GetGenres from condition import Condition, ConditionForm, ConditionSchema from covertype import Covertype, CovertypeForm, CovertypeSchema from owned import Owned, OwnedForm, OwnedSchema @@ -168,8 +168,9 @@ def book(id): book_form.owned.default = book.owned book_form.rating.default = book.rating book_form.process() - genre_list = GetGenreList() - return render_template("book.html", books=book_s, subs=sub_book, book_form=book_form, genre_list=genre_list ) + genre_list = GetGenres() + publisher_list = GetPublishers() + return render_template("book.html", books=book_s, subs=sub_book, book_form=book_form, genre_list=genre_list, publisher_list=publisher_list ) @app.route("/", methods=["GET"]) def main_page(): diff --git a/templates/book.html b/templates/book.html index f40372f..b9a2a9e 100644 --- a/templates/book.html +++ b/templates/book.html @@ -1,6 +1,7 @@ {% extends "base.html" %} {% block main_content %} +

View/Edit Book

{% set keys = [ 'title', 'author', 'publisher', 'genre', 'owned', 'covertype', 'condition', 'year_published', 'rating', 'notes', 'blurb' ] %}
@@ -36,8 +37,16 @@
- {{books[key][0].name}} - +
{% elif key == "author" %}