Explore >> Select a destination


You are here

www.laceyhenschel.com
| | davi.sh
4.7 parsecs away

Travel
| | I often want to include related nested objects in my Django REST Framework ModelViewSets for CRUD operations, but don't want those related objects cluttering up the list view. To accomplish this, you can return a serializer from get_serializer_class() that doesn't include the nested relation when the ViewSet action is list. I ended up doing this on a bunch of viewsets, so I factored the logic out into a separate mixin: from typing import Union from rest_framework import viewsets class ListSerializerMixi....
| | sam.hooke.me
9.9 parsecs away

Travel
| | The home page of Sam Hooke.
| | richardtier.com
9.9 parsecs away

Travel
| | Django Rest Framework integrates well with models to provide out of the box validation, and ModelSerializers allow futher fine-grained custom validation. However, if you're not using a model as the resource of your endpoint then the code required for custom validation of complex data structure can get hairy. If there is a heavily nested data...
| | www.pullrequest.com
35.5 parsecs away

Travel
| Reading these foundational books will help you understand software development processes more, how to reduce technical debt, and contribute higher-quality code.