* Add a UserProfile class to store stuff about users.
authorMatthijs Kooijman <matthijs@stdin.nl>
Thu, 7 Feb 2008 19:24:20 +0000 (20:24 +0100)
committerMatthijs Kooijman <matthijs@stdin.nl>
Thu, 7 Feb 2008 19:24:20 +0000 (20:24 +0100)
base/models.py
settings.py

index 137941ffaef5f37858adc11dbf608734c570dd38..9d910f34be7e8b732277e306908f0a7632dc16a4 100644 (file)
@@ -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
index 9805d75b1607730f5ff19aa51323568b7af03566..bef6aa8e11d3730ab9c7d5bbef722ddd487d2fc5 100644 (file)
@@ -110,3 +110,5 @@ AUTHENTICATION_BACKENDS = (
     'ee.auth.PhpBBBackend',
     'django.contrib.auth.backends.ModelBackend',
 )
+
+AUTH_PROFILE_MODULE = 'base.UserProfile'