hello

I have question and problem at the same time, I have two models in 
deferents, projects like this

PROJECT: TransactionMaster.models => TransactionMaster

class TransactionMaster(models.Model):
       user = models.ForeignKey(User, on_delete=CASCADE)
       trans_status = models.BooleanField()
       trans_name = models.CharField()

PROJECT: TransactionDetails.models => TransactionDetail

from app.transactionMaster.models import TransactionMaster

class TransactionDetail(models.Model):
       transaction = models.ForeignKey(TransactionMaster, on_delete=CASCADE)
       current_status = models.IntegerField()
       transdetail_name = models.CharField() 


how Can I do the next sql query

SELECT * FROM User as u inner join TransactionMaster as tm in 
u.id=tm.user_id inner join TransactionDetail as td in tm=td.transaction_id 
where tm.trans_status=td.current_status


and 

SELECT * FROM TransactionMaster as tm inner join TransactionDetail as td in 
tm.id=td.transaction_id where tm.trans_status=td.current_status

I try the second query like this:

TransactionDetail.object.filter(TransactionMaster__id=transaction_id, 
trans_status=TransactionMaster__current_status)


Please help me with this queries, and could you answer me what can I do in 
models in diferents project please.


thanks for your attention
Angel Rojas






-- 
You received this message because you are subscribed to the Google Groups 
"Django REST framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-rest-framework+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to