Let's see whether you can answer the following questions correctly.
- The
related_name
argument for thedjango.db.models.ForeignKey
class initializer specifies:- The name to use for the relation from the related object back to this object
- The related model class name
- The related model primary key attribute name
- If we use the following line to declare the
pilot
field in theCompetition
model:pilot = models.ForeignKey(Pilot, related_name='competitions', on_delete=models.CASCADE)
. What will Django's ORM do whenever we delete a specific Pilot?- All the related competitions in which this
Pilot
participated will remain without changes in the database - All the related competitions in which this
Pilot
participated will be deleted too - All the related pilots that are related to the Competition will be deleted too
- All the related competitions in which this
- The
rest_framework.serializers.HyperlinkedModelSerializer
class is a type ofModelSerializer
that represents the relationships to other model instances with:- Primary key values
- Foreign...