Skip to Content
Django RESTful Web Services
book

Django RESTful Web Services

by Gastón C. Hillar
January 2018
Intermediate to advanced
326 pages
7h 38m
English
Packt Publishing
Content preview from Django RESTful Web Services

Test your knowledge

Let's see whether you can answer the following questions correctly.

  1. The related_name argument for the django.db.models.ForeignKey class initializer specifies:
    1. The name to use for the relation from the related object back to this object
    2. The related model class name
    3. The related model primary key attribute name
  1. If we use the following line to declare the pilot field in the Competition model: pilot = models.ForeignKey(Pilot, related_name='competitions', on_delete=models.CASCADE). What will Django's ORM do whenever we delete a specific Pilot?
    1. All the related competitions in which this Pilot participated will remain without changes in the database
    2. All the related competitions in which this Pilot participated will be deleted ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Building Versatile Mobile Apps with Python and REST: RESTful Web Services with Django and React

Building Versatile Mobile Apps with Python and REST: RESTful Web Services with Django and React

Art Yudin

Publisher Resources

ISBN: 9781788833929Supplemental Content