Lab 9
Using a Python database interface
Submit after the end of the lab session

Overview

You will study the Movies class, which interfaces with a database. You will then add two additional methods and test them.

Instructions and code writing

  1. Download the zip folder for the lab.
  2. Interactively experiment with the Movies class and its methods to understand how it works.
  3. Using the methods as a guide, create a new method called show_recent that takes one integer parameter (after self) that represents the year. It should show (print) all movies that appear after that specified year. Note that there are two ways to select the recent movies: 1) by using the database query or 2) by having Python select them. For this lab, either way is fine.
  4. Note that title_search returns a list of movie records. Write a method called display_by_title. Like title_search, it should take a string representing part of a title and call title_search to obtain the list of matching movie records. It should then print the matching movies in a suitable format of your design.
  5. Write a test script that shows that your new methods work.

Deliverable

Create a text (preferred) or pdf file that contains the following:

  1. A statement that summarizes your completion of the lab. As appropriate, the statement should include the following:
    • Who you worked with on the lab
    • Any difficulties you encountered
    • Your summary of your experience
    • Any documentation that shows that your code works
    • A summary of the files included in your submitted folder

Put your file and Python code in a folder, zip it and submit it under Lab 9 on D2L. Check that your submitted zip file is complete.

Grading

Your lab submission will be graded using the following rubric:

  • + .5 --- Your submission is clearly formatted.
  • + .5 --- Your submission includes a summary statement and includes how you collaborated.
  • + .5 / 1.0 --- You submitted most of the lab (0.5) or you submitted all of the lab (1.0).
  • + .5 --- Your lab submission is generally correct.