Re: how to do inner join using 3 tables

2018-03-08 Thread Simon Charette
Hello Angel, Did you try the following transaction = Transaction.objects.filter( user=user, status=F('detail__status'), ).first() Best, Simon Le jeudi 8 mars 2018 09:52:44 UTC-5, Angel Rojas a écrit : > > Hello friends, I have a little problem with a relationship with 3 tables > > table

Re: how to do inner join using 3 tables

2018-03-08 Thread Angel Rojas
thank you for your answer, but I need a next result select * select User as u inner join transaction as tr on u.id=user_id.id inner join transactionDetail as trd on tr.id=trd.transaction_id where tr.current_status=trd.status please how can I do that thanks for your attention. On Thursday

Re: how to do inner join using 3 tables

2018-03-08 Thread C. Kirby
As written it looks like you want to get all the 0 status transactions for a given user, and then get all the transaction details for those transactions (.filter allows for any number of results) Since your var transaction is a list, and you really only care about the ids to pull the transactio

how to do inner join using 3 tables

2018-03-08 Thread Angel Rojas
Hello friends, I have a little problem with a relationship with 3 tables tables - User - Transaction - TransactionDetail my query is class TransactionInitiated(generics.ListAPIView): """ List Transaction Initiated """ serializer_class = TransactionSerializer def get_obje