Python Learning Journal: Step 3

We’ve moved on from our basic Pyramid application to something including SQL persistence. The walk-through is intended to get you to a working application as quickly as possible.

There will be many questions left unanswered as we proceed. Fear not. The answers will come as this course progresses. For now, simply focus on the process and getting to a working application.

Tasks

Create a new branch (step3) for today’s work. Do your work on this branch.

Using what you learned today, both in class and in your readings, accomplish the following tasks for your learning journal along with your partner:

  • Create the data model for your Learning Journal Entries. Though you may add more as you please, your Entry model should have at least these attributes:

    • id
    • title
    • body
    • creation date
  • Your list of current learning journal entries (the in that data directory from yesterday) should now be put into your database as model instances whenever initializedb is called from the command line.

  • Modify all of your views so that they call on the database (e.g. your list view performs a query to get all of the journal entries, and your detail view serves up one entry).

  • Enable the notfound view, and create a template for the 404 page that matches the overall style of your website.

  • Your create and update views should remain non-functional. That’s for tomorrow.

Your code should be thoroughly tested. Write unit tests of the view functions themselves, unit tests for your models, and functional tests that show the configured system works properly.

You are working with a partner to complete this application.

When all of the above work is completed, update your deployment to Heroku. You’re using Postgres now and that’s going to mean some changes in your application. Consult the Pyramid-Heroku Deployment document from Monday, specifically the portion concerning Postgres.

Make sure to include the URL to your Heroku deployment in your README.md file. Update your README.md to include the coverage output of your tests for Python 2 and Python 3 for this branch. You should have coverage reports for both the step2 branch and the step3 branch in your README.md.

Submitting Your work

When your work is done and your site is deployed, push all of your work to your GitHub repo. Open a new pull request from the step3 branch to master. Submit the URL of that pull request to Canvas.

Finally, merge your pull request to prepare for the work in Python Learning Journal: Step 4

Use the comment feature in canvas to submit the following:

  • At least one well-formed question about the work you did for this assignment
  • At least one comment on what went well
  • At least one comment on what was particularly difficult or challenging