title: How to access reverse relationship in django models?
body: <p>I have two models one for User and another for storing CustomerInfo(user of type customer).</p>
  <pre><code>class User(AbstractBaseUser):
      &quot;&quot;&quot; 
      This is a class for user table which overrides functionalities of default django user model.
        
      Attributes: 
          name (CharField): Name of a user.
          email (EmailField): Email address of a user. 
          mobile (CharField): Phone number of a user.
          date_joined (CharField): When a user was added.
          last_login (CharField): Last login date time of a user.
          is_admin (CharField): If user is a admin or not.
          is_active (CharField): If user is active or not.
          is_staff (CharField): If user is staff or not.
          is_superuser (CharField): If user is a superuser or not.
          role (OneToOneField): One to one relationship with role table.
      &quot;&quot;&quot;
  
      name = models.CharField(max_length=80)
      email = models.EmailField(max_length=255, unique=True)
      mobile = models.CharField(
          validators=[
              RegexValidator(
                  regex=r&quot;^\d{10,14}$&quot;,
                  message=&quot;Phone number must be entered in format: '+999999999'. Up to 14 digits allowed.&quot;,
              )
          ],
          max_length=15,
          unique=True,
      )
      role = models.ForeignKey(Role, on_delete=models.SET_NULL, null=True)
      drivers = models.ManyToManyField(
          &quot;self&quot;, through=&quot;DispatcherDriver&quot;, symmetrical=False
      )
      date_joined = models.DateTimeField(auto_now_add=True)
      last_login = models.DateTimeField(auto_now=True)
      is_admin = models.BooleanField(default=False)
      is_active = models.BooleanField(default=True)
      is_staff = models.BooleanField(default=False)
      is_superuser = models.BooleanField(default=False)
      created_at = models.DateTimeField(auto_now_add=True, null=True, blank=True)
      updated_at = models.DateTimeField(auto_now=True, null=True, blank=True)
  
      USERNAME_FIELD = &quot;mobile&quot;
  
      REQUIRED_FIELDS = [&quot;email&quot;, &quot;name&quot;]
  
      objects = UserManager()
  
      class Meta:
          db_table = &quot;users&quot;
  
      def __str__(self):
          return self.name
  
      # For checking permissions. to keep it simple all admin have ALL permissons
      def has_perm(self, perm, obj=None):
          return self.is_admin
  
      # Does this user have permission to view this app? (ALWAYS YES FOR SIMPLICITY)
      def has_module_perms(self, app_label):
          return True
  
  
  @receiver(post_save, sender=settings.AUTH_USER_MODEL)
  def create_auth_token(sender, instance=None, created=False, **kwargs):
      if created:
          Token.objects.create(user=instance)
  
  
  class CustomerInfo(models.Model):
      customer = models.OneToOneField(
          User, on_delete=models.CASCADE, primary_key=True, related_name=&quot;customer_info&quot;
      )
      company_name = models.CharField(max_length=255)
  
      class Meta:
          db_table = &quot;customer_info&quot;
  
      def __str__(self):
          return self.company_name
  </code></pre>
  <p>CustomerInfo model has OneToOneField mentioned in the model. How can I access CustomerInfo of a User model using reverse relationship?</p>