[Django]-Django get all related values of the model

5👍

First, you query by

orders = Order.objects.select_related('orderdetail__comment', 'lastupdate__date')

then, get values by

orders.values('name', 'orderdetail__comment', 'lastupdate__date')
👤iMom0

Leave a comment