"DRF Deep" makes working with nested resources easy

33 views
Skip to first unread message

goo...@stschindler.io

unread,
Jan 12, 2017, 7:02:34 PM1/12/17
to Django REST framework
Hey guys!

I've been using a collection of mixins in several (private) projects in the last couple of months/years, and I'd like to finally share them with you.

DRF Deep is basically a serializer mixin that allows to work with nested resources in a very easy way; of course both for reading and writing. You just have to tell Deep what fields on a serializer you want to be embedded, so that they are from now on send inline in GET responses, but also properly handled in POST/PUT/PATCH requests.

More information, explanation and a tiny example is available here: https://github.com/stschindler/djangorestframework-deep
Download via `pip install djangorestframework-deep`.

Please be aware that the code has been decoupled from bigger projects, and I wasn't able to decouple everything. Therefore the package currently lacks unit tests and comprehensive documentation. But as it's really easy to use and I'd like to get some feedback, feel free to test it out! Also if you find bugs, please report them — although it's being used in production, this decoupled version is different, so it might contain flaws.

Greetings,
Stefan

Tom Christie

unread,
Jan 13, 2017, 5:47:35 AM1/13/17
to Django REST framework
Great stuff Stefan, thanks for this.
Something that plenty of folks have asked for so great to see it now available as a third party package!

  - t

Reply all
Reply to author
Forward
0 new messages