title: Query for manytomany multiple tables for getting data of multiple models in django
body: <p>I'm trying to solve following case:</p>
  
  <p>many Student has many subjects but only some subjects are marked as his current subjects, one classroom has multiple subjects, student may carry subjects of other classroom which can be checked from his current classroom. </p>
  
  <p>I want to get all those subjects which student currently has with all classroom those subject has with the status of classroom, either current or not.</p>
  
  <pre><code>class Student(models.model):
      id = models.OnetoOneField(User)
  
  class Subject(models.Model):
      Subject_Master_Id=models.AutoField(primary_key=True)
      Subject_Name=models.CharField(max_length=100,blank=False,unique=True)
      user = models.ManyToManyField(Student,through = 'Student_Subject')
  
  class Classroom(models.Model):
      Class_Master_Id=models.AutoField(primary_key=True)
      Classroom_Student = models.ManyToManyField(Student,through='Classroom_Student',related_name='classroom_student')
      Classroom_Subject = models.ManyToManyField(Subject,through='Classroom_Subject',related_name='classroom_subject')
  
  class Student_Subject(models.Model):
      Student_Subject_Id = models.AutoField(primary_key=True)
      subject= models.ForeignKey(Subject,on_delete =  models.CASCADE, related_name='student_subject')
      user=models.ForeignKey(Student,on_delete = models.CASCADE, related_name='student_subject')
      is_current = models.BooleanField()    
  
  class Classroom_Student(models.Model):
      Classroom_Student_Id=models.AutoField(primary_key=True)
      Classroom_Id=models.ForeignKey(Classroom,on_delete=CASCADE)
      Student_Id=models.ForeignKey(Student,on_delete=CASCADE, related_name= 'student')
      is_current = models.BooleanField()
  
  class Classroom_Subject(models.Model):
      Classroom_Subject_Id=models.AutoField(primary_key=True)
      Classroom_Id=models.ForeignKey(Classroom,on_delete=CASCADE)
      Subject_Id=models.ForeignKey(Subject,on_delete=CASCADE, related_name='subject') 
  </code></pre>