drf-keyed-list (pypi): A reference implementation for converting a list of objects into a dict where the key is a (unique) value from the object (e.g. {<id1>: {<object1>}, <id2>: {<object2>}... }
Keywords: drf|restframework|rest_framework|django_rest_framework|serializers|drf_mapped_nested