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

Configuring serialization and deserialization with relationships

The new RESTful Web Service must be able to serialize the DroneCategory, Drone, Pilot, and Competition instances into JSON representations and vice versa. In this case, we must pay special attention to the relationships between the different models when we create the serializer classes to manage serialization to JSON and deserialization from JSON.

In our last version of the previous RESTful Web Service, we created a subclass of the rest_framework.serializers.ModelSerializer class to make it easier to generate a serializer and reduce boilerplate code. In this case, we will also declare one class that inherits from ModelSerializer. The other three classes will inherit from the ...

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