Recursions can be hard to understand. In this article, I am proposing a different way of thinking to make it easier to construct and work with recursive functions
tutorial
In this article we will look at how to create your own recursive serializer in Django without using the Django Rest Framework Sometimes when working with Django, we may have some data that we want to serialize (convert to JSON) but we do not have the option of using the serializers that come with Django Rest Framework. The data can also take the same form for many cases and writing a new serializer for all of those cases can be tedious and repetitive.
Permissions can be a hustle to deal with when developing an api. Suppose we have a number of api views and endpoints where the access permissions are very similar to one another with only slight variations..
We could create different permission classes with the slight changes that fit the specific endpoint’s needs. That works, but that involves a lot of repetition and duplicated code that can be hard to update later down the line.