Project Challenge: Create User and Pet Models

In this challenge, we will be initializing a database connection and creating the User and Pet models in the project application.

We'll cover the following

Problem statement #

Up until now, we have been using lists of dictionaries to store the information related to users and pets in our project. However, now that we have learned how to use the database, we can create models for these entities instead.

Therefore, in this challenge, you will complete the following tasks:

  1. Initiate a database connection with an SQLite database.
  2. Create models called Pet and User to store the data that we previously stored in the lists.
  3. The email column of the User model and the name column of the Pet model should contain the unique constraint on them.
  4. Create the tables in the database associated with the models.

Get hands-on with 1400+ tech skills courses.