I have 3 related tables, 1 - > 2 - > 3 Now with mysql we would do inner join of the tables and now we could filter by fields of the 3, the thing is that with the REST API I would like to nest all the elements of the 3 related to the 2 related to the once with the 1st and I just calling the first one.
The thing is that I get to nest all the tables related to the 1, but all that are related to those that are related to the 1 can not access them or nest me.
that is, I can do a 1Model.object.filter (2__2_name="Antonio") it works, but I would like to be able to 1Model.object.filter (2__2_name="Antonio", 3__3_type="House") and return all nested 1 to 2 and 3, just calling 1.
How should I relate the serializers or how to filter the views so I can access the third level?
I do not know if I explain myself very clearly but to give an example:
I would like to be able to filter with the REST API of Django that I return all the questions and answers of a brand and a specific language and I do not know how to relate the serializers or get that info in the view or viewset. The filtering of a single table or one that is directly related is no problem, but when I have to cross so much I get messed up.
How should I do it? Django Multiple Models, ModelViewset, ViewsetMixin or how? The documentation is not clear enough in my opinion.