How can I fetch the data of one table by joining the other tables in django

0 votes
Need help in making a query, i am new to django and i am stuck in this.

Models.py

class Application(models.Model):

   access_key_id = models.CharField(max_length=100)

   access_key_secret = models.CharField(max_length=100)

class Order(models.Model):

    application= models.ForeignKey(Application, on_delete=models.CASCADE)

class Payment(models.Model):

    order = models.ForeignKey(Order, on_delete=models.CASCADE)

    source_payment_id = models.IntegerField(blank=True,null=True)

I have Application's object as below:

app = Application.objects.get( access_key_id=123sd, access_key_secret=de454f)

how can i join the tables to make query and get the payment whose id is source_payment_id parameter and its order's application is app ?
Jun 17, 2021 in Python by anonymous

edited Mar 4 8 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP