title: How do I access the ATTRIBUTE of a Foreign Key Object in another Model?
body: <pre><code>class doctorMaster(models.Model):
  
      doctorID = models.AutoField(primary_key=True)
      doctorName = models.CharField(max_length=100,null=False)
      doctorDesignation = models.CharField(max_length=100,null=True)
      doctorSpecialization = models.CharField(max_length=100,null=True)
      UpdatedOn = models.DateTimeField(default=timezone.now, null=True)
  
      def __unicode__(self):
          return str(self.doctorID)
  
  
  
  class SMSlookup(models.Model):
      recordID = models.AutoField(primary_key=True)
      doctorID = models.OneToOneField(doctorMaster,on_delete=models.CASCADE,to_field='doctorID')
      doctorName = models.CharField(max_length=100,null=False)
      SMSContact = models.IntegerField (null = False)
      UpdatedOn = models.DateTimeField(default=timezone.now, null=True)
  
      def __unicode__(self):
          return str(self.doctorID)
  </code></pre>
  
  <p>I need to be able to access doctorID of the first model using its namesake in the second.</p>
  
  <p>How should doctorID be defined for this to be possible?</p>