Learn

Adding another model or table schema to your application is simple. You only need to create another class that inherits from Model.

The model you will create next, Reader, is simple and similar to Book. Let us try it together. You can do this!

To make it easier for you, here’s the schema representation of Reader: title

We have already provided the Reader class declaration and the representation method.

Instructions

1.

Add to the model a column called name that is of type String with at most 50 characters. It is indexable and not unique.

2.

Add to the model a column called surname that is of type String with at most 80 characters. It is indexable and not unique.

3.

Add to the model a column called email that is of type String with at most 120 characters. It is indexable and unique.

Sign up to start coding

By signing up for Codecademy, you agree to Codecademy's Terms of Service & Privacy Policy.
Already have an account?