1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
# -*- coding: cp1252 -*-
from django.db import models
from django.contrib.auth.models import User
from country.models import Pays
# Create your models here.
class YourProfile(models.Model):
user=models.ForeignKey(User,unique=True)
civilite=models.CharField(u'Civilité',max_length=4,choices=((u'Mlle',u'Mademoiselle'),(u'Mme',u'Madame'),(u'M.',u'Monsieur')))
nom=models.CharField("Nom",max_length=12)
prenoms=models.CharField(u"Prénoms",max_length=25)
naissance=models.DateField(u"Date de naissance")
nationalite=models.ForeignKey(Pays)
last_modification=models.DateField(auto_now=True)
adhesion=models.DateField(auto_now_add=True)
def __unicode__(self):
return self.user
class Meta:
ordering=['-adhesion','-last_modification']
verbose_name=u"Profile"
verbose_name_plural=u"Les Profiles" |