from django.db import models

class FacebookProfileModel(models.Model):
    '''
    Abstract class to add to your profile model.
    
    NOTE: If you don't use this this abstract class, make sure you copy/paste
    the fields in.
    '''
    about_me = models.TextField(blank=True, null=True)
    facebook_id = models.IntegerField(blank=True, null=True)
    facebook_name = models.CharField(max_length=255, blank=True, null=True)
    facebook_profile_url = models.TextField(blank=True, null=True)
    website_url = models.TextField(blank=True, null=True)
    blog_url = models.TextField(blank=True, null=True)
    image = models.ImageField(blank=True, null=True, upload_to='profile_images')
    date_of_birth = models.DateField(blank=True, null=True)
    
    class Meta:
        abstract = True
from django.db import models
from django.contrib.auth.models import User

class FacebookProfileModel(models.Model):
    '''
    Abstract class to add to your profile model.
    
    NOTE: If you don't use this this abstract class, make sure you copy/paste
    the fields in.
    '''
    user = models.OneToOneField(User)
    about_me = models.TextField(blank=True, null=True)
    facebook_id = models.IntegerField(blank=True, null=True)
    facebook_name = models.CharField(max_length=255, blank=True, null=True)
    facebook_profile_url = models.TextField(blank=True, null=True)
    website_url = models.TextField(blank=True, null=True)
    blog_url = models.TextField(blank=True, null=True)
    image = models.ImageField(blank=True, null=True, upload_to='profile_images')
    date_of_birth = models.DateField(blank=True, null=True)

    def __unicode__(self):
       return self.user.__unicode__()
    
    class Meta:
        abstract = True

Add reference to user model and __unicode__() method to FacebookProfileModel
Add reference to user model and __unicode__() method to FacebookProfileModel

  from django.db import models
+ from django.contrib.auth.models import User
  
  class FacebookProfileModel(models.Model):
      '''
      Abstract class to add to your profile model.
      
      NOTE: If you don't use this this abstract class, make sure you copy/paste
      the fields in.
      '''
+     user = models.OneToOneField(User)
      about_me = models.TextField(blank=True, null=True)
      facebook_id = models.IntegerField(blank=True, null=True)
      facebook_name = models.CharField(max_length=255, blank=True, null=True)
      facebook_profile_url = models.TextField(blank=True, null=True)
      website_url = models.TextField(blank=True, null=True)
      blog_url = models.TextField(blank=True, null=True)
      image = models.ImageField(blank=True, null=True, upload_to='profile_images')
      date_of_birth = models.DateField(blank=True, null=True)
+ 
+     def __unicode__(self):
+        return self.user.__unicode__()
      
      class Meta:
          abstract = True
+ 
Add reference to user model and __unicode__() method to FacebookProfileModel
## Code Before:
from django.db import models

class FacebookProfileModel(models.Model):
    '''
    Abstract class to add to your profile model.
    
    NOTE: If you don't use this this abstract class, make sure you copy/paste
    the fields in.
    '''
    about_me = models.TextField(blank=True, null=True)
    facebook_id = models.IntegerField(blank=True, null=True)
    facebook_name = models.CharField(max_length=255, blank=True, null=True)
    facebook_profile_url = models.TextField(blank=True, null=True)
    website_url = models.TextField(blank=True, null=True)
    blog_url = models.TextField(blank=True, null=True)
    image = models.ImageField(blank=True, null=True, upload_to='profile_images')
    date_of_birth = models.DateField(blank=True, null=True)
    
    class Meta:
        abstract = True
## Instruction:
Add reference to user model and __unicode__() method to FacebookProfileModel
## Code After:
from django.db import models
from django.contrib.auth.models import User

class FacebookProfileModel(models.Model):
    '''
    Abstract class to add to your profile model.
    
    NOTE: If you don't use this this abstract class, make sure you copy/paste
    the fields in.
    '''
    user = models.OneToOneField(User)
    about_me = models.TextField(blank=True, null=True)
    facebook_id = models.IntegerField(blank=True, null=True)
    facebook_name = models.CharField(max_length=255, blank=True, null=True)
    facebook_profile_url = models.TextField(blank=True, null=True)
    website_url = models.TextField(blank=True, null=True)
    blog_url = models.TextField(blank=True, null=True)
    image = models.ImageField(blank=True, null=True, upload_to='profile_images')
    date_of_birth = models.DateField(blank=True, null=True)

    def __unicode__(self):
       return self.user.__unicode__()
    
    class Meta:
        abstract = True
