Modern Application Development I, End Term
Consider the following models Library and Book corresponding to tables library and book in SQLite database.
class Library(db.Model): id = db.Column(db.Integer(), primary_key = True) name = db.Column(db.String(), unique = True)
class Book(db.Model): id = db.Column(db.Integer(), primary_key = True) name = db.Column(db.String(), unique = True) library = db.Column(db.Integer(), unique = True, db.ForeignKey("section.id"))Based on the model schemas, what relationship do the classes Library and Book share?
Consider the following models `Library` and `Book` corresponding to tables `library` and `book` in SQLite database. class Library(db.Model): id = db.Column(db.Integer(), primary_key = True) name = db.Column(db.String(), unique = True) class Book(db.Model): id = db.Column(db.Integer(), primary_key = True) name = db.Column(db.String(), unique = True) library = db.Column(db.Integer(), unique = True, db.ForeignKey("section.id")) Based on the model schemas, what relationship do the classes `Library` and `Book` share? Consider the following python code snippet “app.py”, the HTML files, “base.html” and “home.html” residing in “templates” folder. app.py from flask import Flask, render_template app = Flask(__name__) @app.route('/') def home(): return render_template('home.html') app.run(debug=True) home.html {% extends "base.html" %} {% block content %} <h3>This is from home.html</h3> {% endblock %} base.html <!DOCTYPE html> <html lang="en"> <head> <title>Document</title> </head> <body> <h3 style="color: blue;"> This is from base.html </h3> {% block content %} {% endblock %} </body> </html> What will be the rendered output for base URL if flask app is running locally on http://localhost:5000 Consider the following Python code snippet. from string import Template sentence = Template("A $var1 fox $var2 over the $var3 dog") output = sentence.safe_substitute(word_dict) print(output) Which of the following options correctly represent(s) the dictionary `word_dict`, such that the code does not throw any error when run in the terminal?