Reputation: 125
clients = Client.objects.filter(user_id=request.user)
quotes = Quote.objects.filter(customer_act_id=clients)
I have the above code and I am trying to display the users clients and quotes to the user. The clients display fine but the quotes only show the quotes for the FIRST client and not all of them. Any help is appreciated.
Relationships:
User has_many clients(user_id FK) has_many quotes(client_id FK)
Upvotes: 0
Views: 41
Reputation: 61
Ben is right. Using customer_act_id__in=clients should do the trick. Could you double check if the clients are associated with the same user, then?
Upvotes: 2