[Fixed]-How to return JSON Response correctly in joining multiple table in Django

1👍

Since you only need description field from all 3 models, you can also use values method or maybe values_list of the queryset and get data.

So this new query would be
ModelThree.objects.filter(description__icontains='beauty').select_related('m2__m1).values_list('description','m2__description','m2__m1__description')

Next if you want to run some changes to your data, you can run a map method in case you want to make similar changes to all the data.

Next you can make the appropriate json and send to to client side.

Leave a comment