From af10fc8cc1721d642fbfc3b6b11ae2dfb881fa0a Mon Sep 17 00:00:00 2001 From: Matthijs Kooijman Date: Thu, 7 Feb 2008 20:24:20 +0100 Subject: [PATCH] * Add a UserProfile class to store stuff about users. --- base/models.py | 27 +++++++++++++++++++++++++++ settings.py | 2 ++ 2 files changed, 29 insertions(+) diff --git a/base/models.py b/base/models.py index 137941f..9d910f3 100644 --- a/base/models.py +++ b/base/models.py @@ -1 +1,28 @@ from django.db import models +from django.utils.translation import ugettext_lazy as _ +from django.conf import settings +from django.contrib.auth.models import User + +class UserProfile(models.Model): + user = models.ForeignKey(User, unique=True, verbose_name=_("User")) + address = models.CharField(max_length=100, verbose_name=_("Address")) + # We won't use something NL specific here, or set a maxlength of 6, + # to allow for zipcodes from other countries. + zipcode = models.CharField(max_length=10, verbose_name=_("Zipcode")) + town = models.CharField(max_length=100, verbose_name=_("Town")) + birthdate = models.DateField(verbose_name=_("Birthdate")) + # Allow for multiple numbers + telephone = models.CharField(max_length=50, verbose_name=_("Telephone number")) + anonymous = models.BooleanField(verbose_name=_("Hide my full name")) + + vegetarian = models.BooleanField(verbose_name=_("Vegetarian")) + foodallergies = models.CharField(max_length=100,blank=True, verbose_name=_("Food allergies")) + otherallergies = models.CharField(max_length=100, blank=True, verbose_name=_("Other allergies")) + bloodgroup = models.CharField(max_length=50, blank=True, verbose_name=_("Blood group")) + othermedical = models.TextField(blank=True, verbose_name=_("Other medical issues")) + + warnname = models.TextField(verbose_name=_("Warn in case of accident (name)")) + warntelephone = models.TextField(verbose_name=_("Warn in case of accident (phone number)")) + + class Admin: + pass diff --git a/settings.py b/settings.py index 9805d75..bef6aa8 100644 --- a/settings.py +++ b/settings.py @@ -110,3 +110,5 @@ AUTHENTICATION_BACKENDS = ( 'ee.auth.PhpBBBackend', 'django.contrib.auth.backends.ModelBackend', ) + +AUTH_PROFILE_MODULE = 'base.UserProfile' -- 2.30.2