Lately, I faced a problem while working on a RESTful API using Django and DRF, my mentor was thinking that it was solvable in one line of code, but then we googled the issue only to find that it had been addressed in several questions on Stackoverflow with no accepted answer, and BOOM that is where the adventure started.
Actually the problem at first glance seems easy, Paginating a set of objects inside another object. Suppose we have an Author
, and a Book
with a foreign key to the Author
, simple and straight forward. Now, we want to send a…