Define Other Models
Let's continue to create our application. So, we continue to write our Models inside the models.py file.
Note
An id field is automatically added as a primary key for each model instance. You don't need to declare it explicitly in your models.
We haven't created any relations between our Models yet, but we'll address this shortly.
1. In the Book model, you wish to add three new fields: 'publishing_date', 'rating', and 'quantity'. Which combination of field types is the most appropriate for these fields?
2. What is the primary purpose of the '__str__' method in a Django model?
Дякуємо за ваш відгук!
Запитати АІ
Запитати АІ
Запитайте про що завгодно або спробуйте одне із запропонованих запитань, щоб почати наш чат
Awesome!
Completion rate improved to 3.57
Define Other Models
Свайпніть щоб показати меню
Let's continue to create our application. So, we continue to write our Models inside the models.py file.
Note
An id field is automatically added as a primary key for each model instance. You don't need to declare it explicitly in your models.
We haven't created any relations between our Models yet, but we'll address this shortly.
1. In the Book model, you wish to add three new fields: 'publishing_date', 'rating', and 'quantity'. Which combination of field types is the most appropriate for these fields?
2. What is the primary purpose of the '__str__' method in a Django model?
Дякуємо за ваш відгук!