title: Django - models.ForeignKey
body: <p>Thanks for checking this out.</p>
  
  <p>Silly doubt of mine:</p>
  
  <p>I have the following models defined in Django:</p>
  
  <pre><code>class School(models.Model):
      name = models.CharField(max_length=256)
      principal = models.CharField(max_length=256)
      location = models.CharField(max_length=256)
  
      def __str__(self):
          return self.name
  
  class Student(models.Model):
      name = models.CharField(max_length=256)
      age = models.PositiveIntegerField() # positive integer only accepts positives
      school = models.ForeignKey("School", related_name='students', on_delete=models.CASCADE)
  
      def __str__(self):
          return self.name
  </code></pre>
  
  <p>My question is: How does Django knows to pick the School.name field as a match for the foreign key school?
  As when I check on the Admin page and add a student, I can select the name of the school (as the foreign key).
  Name:
  Age:
  School = (drop down with the name of the schools)</p>
  
  <p>Is it the order of the elements or something else?</p>
  
  <p>Thanks again!</p>