Join over django models

djangodjango-modelsjoin

I want to get the result in one list using three different models in django. How do i apply join over three models.

class CurrentDomainChecks(models.Model):

    domain = models.ForeignKey(Domains)
    check_type = models.ForeignKey(CheckType)
    check_date = models.DateTimeField(auto_now_add = True, primary_key=True)
    check_value = models.CharField(_('check value'), max_length = 2048)
    check_passed = models.BooleanField(default = False)

class DomainStatus(models.Model):

    domain = models.ForeignKey(Domains)
    domain_status_date = models.DateTimeField(auto_now_add=True,null = True, blank = True)
    domain_status = models.IntegerField(null = True, blank = True)

class Domains(models.Model):

    domain_name = models.CharField(_('domain name'), max_length = 255, unique = True)
    verified = models.BooleanField(default = False)
    user = models.ForeignKey(User)
    date_added = models.DateTimeField(auto_now_add=True,null = True, blank = True)
    date_last_changed = models.DateTimeField(auto_now=True,null = True, blank = True)
    monitoring_frequency = models.CharField(_('monitoring frequency'), max_length = 20,blank = True,null = True)

    def __unicode__(self):
        return self.domain_name 

Best Solution

Did you read this about JOIN ?

Django: implementing JOIN using Django ORM?

Related Question