diff --git a/templates/book.html b/templates/book.html new file mode 100644 index 0000000..28fe906 --- /dev/null +++ b/templates/book.html @@ -0,0 +1,8 @@ + +
cover:
+{% endif %} +{% for datum in (book|dictsort) %} +{{datum[0]}}: {{ datum[1] }}
+{% endfor %} diff --git a/test.py b/test.py index 0896042..fde6fe9 100644 --- a/test.py +++ b/test.py @@ -20,6 +20,7 @@ def updateData(): for book in collection.iter(ns + "entry"): bookout = {} + bookout["id"] = int(book.find(ns + "id").text) bookout["title"] = book.find(ns + "title").text if (book.find(ns + "title") != None) else "" bookout["isbn"] = book.find(ns + "isbn").text if (book.find(ns + "isbn") != None) else "" authors = [] @@ -36,6 +37,11 @@ def main(): data = updateData(); return render_template("main.html", books = data, attributes = attributes) +@app.route("/book/