summaryrefslogtreecommitdiff
path: root/src/meetingtools/apps/userprofile/models.py
blob: b0bc7aeb052132cc74b603346c8b869a98a5e0c2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
'''
Created on Jul 5, 2010

@author: leifj
'''
from django.db import models
from django.contrib.auth.models import User

class UserProfile(models.Model):
    user = models.ForeignKey(User,blank=True,related_name='profile')
    display_name = models.CharField(max_length=255,blank=True)
    email = models.EmailField(blank=True)
    idp = models.CharField(max_length=255)
    timecreated = models.DateTimeField(auto_now_add=True)
    lastupdated = models.DateTimeField(auto_now=True)
    
    def __unicode__(self):
        return "%s - %s" % (self.user.username,self.display_name)

def profile(user):
    return UserProfile.objects.get(user=user)