|
You are here |
stribny.name | ||
| | | | |
www.mattlayman.com
|
|
| | | | | If you use Django REST Framework and the DRF JSON API extension, you may want to learn how to sideload extra resources to save on network requests of commonly paired models. We will explore the extra settings required to make that happen. | |
| | | | |
www.laceyhenschel.com
|
|
| | | | | If you came here from Part 1 of What You Should Know About Django REST Framework, you may be wondering why I just walked you through a bunch of source code. We stepped through that code because if you know what the main methods of the ModelViewSet do and how they work, you know where to go when you want to tweak the behavior of your viewset. You can pull out the method that contains what you want to change, override it with your own custom behavior, and put it back in. In Part 1, we were writing a BookViewSet. So let's go through a few cases where we might want to customize the behavior of our endpoints and walk through how we would do that. | |
| | | | |
www.django-rest-framework.org
|
|
| | | | | Django, API, REST, Serializer relations | |
| | | | |
www.laceyhenschel.com
|
|
| | | One of the things I hear people say about Django is that it's a "batteries included" framework, and Django REST Framework is no different. One of the most powerful of these "batteries" is the ModelViewSet class, which is more of a "battery pack," in that it contains several different batteries. If you have any experience with Django's class-based views, then DRF's viewsets will hopefully look familiar to you. | ||