Skip to content

Dec 02: Final Review, Logistics

Learning Objectives

After today's class, you should be able to:

  • Explain the format and the contents of the final written exam.
  • Identify areas that you need to review and practice this week.

Lesson Outline

Final Review [50 min]

Course Eval [10 min]

GP6 Planning [15 min]

  • GP6 spec and instructions
  • Practice before Thursday!

Exam Content

This is what we are planning. The question order and point values are not 100% guaranteed.

Question Points HW / Lab Readings Class Days
1. Generate Fake Data 12 pts HW4, Faker Faker, ORM Oct 14
2. Create Indexes/Views 12 pts air, Scripts Indexes, Views Oct 16, Oct 21
3. Modify a Model Class 10 pts GP4, FAB Model Views Oct 28
4. Modify a ModelView 10 pts GP4, FAB Model Views Oct 30
5. Implement an Action 10 pts GP5, profs FAB Actions Nov 04, Nov 06
6. Handle WTForm Input 10 pts GP5, profs Base Views Nov 11
7. Perform SQL Injection 8 pts DB-API hack.py/html Nov 11, Sep 02
8. SQL Set Operations 10 pts HW5, air 1.8, 1.10 Nov 13
9. SQL Window Functions 10 pts HW5, air 1.9, 1.11 Nov 13
10. Read NoSQL Queries 8 pts Mongo, Neo4j Mongo, Cypher Nov 18, Nov 20

Attachments:

  • Faker API Reference
  • air Database Diagram
  • air_fab Code Sample

Not on the exam:

  • Flask Quickstart
  • Jinja Templates
  • Google Charts API
  • FAB Chart Views
  • FAB Templates

air_fab Code

Download, unzip, and study air_fab.zip. This sample web app uses the air database. A portion of this code will be provided on the final exam. The zip archive contains the following files:

File Notes
app.py Like profs example, but no IndexView.
config.py Connects to air db using demo user.
menu.py Mostly generated by mvstubs.py.
models.py Mostly generated by sqlacodegen.
views.py Mostly generated by mvstubs.py.

We organized the classes in menu.py, models.py, and views.py to follow the order shown in the air database diagram. We also ran flask fab create-admin to create the admin user with the password 12345.

Warning

The air database is about 9.6 GB, so the provided ModelViews will not load without making adjustments. Flask-AppBuilder preloads relationship data for filters and widgets, which can trigger extremely large queries. As a result, some ModelViews may pull hundreds of megabytes over the network and consume several gigabytes of RAM on your laptop. To make the application functional, you need to remove large relationships from the main UI and expose them only through related views. This way, the related data is loaded one page at a time rather than all at once. Recall what we did on the FAB Tutorial and GP4, for example:

add_exclude_columns = edit_exclude_columns = show_exclude_columns = search_exclude_columns = ["papers"]
related_views = [Paper]