Explore >> Select a destination


You are here

www.django-rest-framework.org
| | corgibytes.com
15.8 parsecs away

Travel
| | I've spent the last couple of months working on an API written using Python, Django, and Django REST Framework (DRF). The latter is a popular, well-established framework for building APIs in Python, so I assumed it would have decent documentation surrounding relational fields, which is a fairly common situation in any model-view-controller (MVC) framework. It turns out that was a faulty assumption.
| | rogs.me
16.4 parsecs away

Travel
| |
| | davi.sh
7.1 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....
| | www.imaginarycloud.com
83.7 parsecs away

Travel
| Angular vs React: which one is better? We were brave enough to build the same app in both frameworks and we're revealing the process here.