Advertisement
Guest User

models.py

a guest
Sep 30th, 2011
254
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.95 KB | None | 0 0
  1. from django.db import models
  2. from django.utils.translation import ugettext_lazy as _
  3. from django.contrib.auth.models import User, Group
  4.  
  5. class UserProfile(models.Model):
  6.  
  7.     GENDER_CHOICES = (
  8.         ('M', 'Male'),
  9.         ('F', 'Female'),
  10.     )
  11.    
  12.     #Links to the user model and will have one to one relationship
  13.     user = models.OneToOneField(User)    
  14.    
  15.     #Other fields thats required for the registration
  16.     gender = models.CharField(_('Gender'), max_length=1, choices=GENDER_CHOICES, null=False)    
  17.     dob = models.DateField(_('Date of Birth'), null=False)    
  18.     address1 = models.CharField(_('Street Address Line 1'), max_length=250, null=False)
  19.     address2 = models.CharField(_('Street Address Line 2'), max_length=250)
  20.     city = models.CharField(_('City'), max_length=100, null=False)
  21.     state = models.CharField(_('State/Province'), max_length=250, null=False)
  22.     pincode = models.CharField(_('Pincode'), max_length=15)
  23.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement