Created
September 14, 2015 14:32
-
-
Save filipgorczynski/311f8d8a073f1f39ed74 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.contrib.auth.models import User | |
from django.db import models | |
class UserProfile(models.Model): | |
user = models.OneToOneField(User) | |
is_organization = models.BooleanField() | |
is_administrator = models.BooleanField() | |
def save(self): | |
super(UserProfile, self).save() | |
self.user.username = self.user.email | |
def __str__(self): | |
return self.email |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment