models.py 382 B

1234567891011
  1. from django.db import models
  2. from django.contrib.auth.models import User
  3. # Create your models here.
  4. class UserProfile(models.Model):
  5. # This line is required. Links UserProfile to a User model instance.
  6. user = models.OneToOneField(User)
  7. # Override the __unicode__() method to return out something meaningful!
  8. def __unicode__(self):
  9. return self.user.username