Accessing objects parent property in django profiles <p>I am using django profiles with having different types of profiles. </p> <p>My Profile Model of Company is similar to:</p> <pre><code>from django.db import models from django.contrib.auth.models import User from accounts.models import UserProfile from jobs.models import City from proj import settings from django.core.mail import send_mail class Company(UserProfile): name=models.CharField(max_length=50) short_description=models.CharField(max_length=255) tags=models.CharField(max_length=50) profile_url=models.URLField() company_established=models.DateField(null=True,blank=True) contact_person=models.CharField(max_length=100) phone=models.CharField(max_length=50) address=models.CharField(max_length=200) city=models.ForeignKey(City,default=True) def send_activation_email(self): self.set_activation_key(self.username) email_subject = 'Your '+settings.SITE_NAME+' account confirmation' email_body = """Hello, %s, and thanks for signing up for an example.com account!\n\nTo activate your account, click this link within 48 hours:\n\nhttp://"""+settings.SITE_URL+"/accounts/activate/%s""" % (self.username,self.activation_key) send_mail(email_subject, email_body, 'acccounts@site.com', [self.email]) </code></pre> <p>Here I am inheriting Company from UserProfile and in send activation email, I am trying to use properties and methods of parent classes user and userprofile. Its direct parent is userprofile while user has onetoone relation with userprofile. So I tried to call <code>self.activation_key</code> that is defined in userpofile and called self.username that is property of user class/table and getting error on self.username . </p> <p>So seems like I am calling self.username in wrong way,so how can I access self.username ? Any detail will be helpful and appreciated.</p>