Explore >> Select a destination


You are here

davi.sh
| | stribny.name
1.4 parsecs away

Travel
| | How to combine request and response serializers into one for use in ModelViewSets.
| | www.laceyhenschel.com
1.3 parsecs away

Travel
| | Sometimes the endpoints you get when you use a ModelViewSet aren't enough and you need to add extra endpoints for custom functions. To do this, you could use the APIView class and add a custom route to your `urls.py` file, and that would work fine. But if you have a viewset already, and you feel like this new endpoint belongs with the other endpoints in your viewset, you can use DRF's @action decorator to add a custom endpoint. This means you don't have to change your urls.py -- the method you decorate w...
| | sam.hooke.me
2.2 parsecs away

Travel
| | The home page of Sam Hooke.
| | www.laceyhenschel.com
20.8 parsecs away

Travel
| This week I needed to manipulate the privacy of a Wagtail page programmatically. The Wagtail docs show you how to edit page privacy in the admin UI, but it doesn't peek behind the curtain to show you the code. The example here is a result of my Google searching.