From 1bba81b0ddd46c665a492aa76e873b25c10a39f7 Mon Sep 17 00:00:00 2001 From: radhikam Date: Wed, 20 Jun 2012 16:34:21 +0530 Subject: added userprofile to INSTALLED_APPS --- stapp/settings.py | 1 + stapp/userprofile/models.py | 18 ++++++++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/stapp/settings.py b/stapp/settings.py index d05ec9d..a688151 100644 --- a/stapp/settings.py +++ b/stapp/settings.py @@ -127,6 +127,7 @@ INSTALLED_APPS = ( 'south', 'video', + 'userprofile', ) # A sample logging configuration. The only tangible logging diff --git a/stapp/userprofile/models.py b/stapp/userprofile/models.py index 1e3de8b..0c0f568 100644 --- a/stapp/userprofile/models.py +++ b/stapp/userprofile/models.py @@ -1,10 +1,24 @@ from django.db import models -from django.contrib.auth.models impport User +from django.contrib.auth.models import User + +GENDER_CHOICES = ( + ('Female', 'Female'), + ('Male' , 'Male'), + ) # Create your models here. class UserProfile(models.Model): - user = models.ForeignKey(User, unique=True) + user = models.OneToOneField(User, unique=True) + dob = models.DateField(auto_now=False) + gender = models.CharField(max_length=6, choices=GENDER_CHOICES) + + def __unicode__(self): + return u"%s the place" % self.user.username + + + + -- cgit