black
This commit is contained in:
parent
223fae94c4
commit
799a62798c
1 changed files with 29 additions and 20 deletions
|
@ -3,31 +3,40 @@ from django.core.validators import MinValueValidator
|
|||
from django.utils.translation import ugettext_lazy as _
|
||||
from django.contrib.auth.models import User
|
||||
|
||||
# Create your models here.
|
||||
|
||||
class Profile(models.Model):
|
||||
user = models.OneToOneField(User, on_delete = models.CASCADE, verbose_name = _('utilisateur'))
|
||||
full_name = models.CharField(max_length = 1023, verbose_name = _('nom'))
|
||||
nickname = models.CharField(max_length = 1023, verbose_name = _('surnom'))
|
||||
picture = models.ImageField(upload_to = 'picture', verbose_name = _('photo'))
|
||||
department = models.ManyToManyField("Department", verbose_name = _('département'))
|
||||
promotion = models.IntegerField(validators = [MinValueValidator(1980)], verbose_name = _('promotion'))
|
||||
birth_date = models.DateField(verbose_name = _('date de naissance'))
|
||||
thurne = models.CharField(max_length = 100, verbose_name = _('thurne'))
|
||||
text_field = models.TextField(verbose_name = _('champ libre'))
|
||||
printing = models.BooleanField(verbose_name = _("apparaître sur l'annuaire papier ?"))
|
||||
keep_me = models.BooleanField(verbose_name = _('conserver la fiche annuaire ?'))
|
||||
# Champ pour les très vielleux plus en scolarité qui veulent garder leur fiche annuaire
|
||||
user = models.OneToOneField(
|
||||
User, on_delete=models.CASCADE, verbose_name=_("utilisateur")
|
||||
)
|
||||
full_name = models.CharField(max_length=1023, verbose_name=_("nom"))
|
||||
nickname = models.CharField(max_length=1023, verbose_name=_("surnom"))
|
||||
picture = models.ImageField(upload_to="picture", verbose_name=_("photo"))
|
||||
department = models.ManyToManyField("Department", verbose_name=_("département"))
|
||||
promotion = models.IntegerField(
|
||||
validators=[MinValueValidator(1980)], verbose_name=_("promotion")
|
||||
)
|
||||
birth_date = models.DateField(verbose_name=_("date de naissance"))
|
||||
thurne = models.CharField(max_length=100, verbose_name=_("thurne"))
|
||||
text_field = models.TextField(verbose_name=_("champ libre"))
|
||||
printing = models.BooleanField(verbose_name=_("apparaître sur l'annuaire papier ?"))
|
||||
keep_me = models.BooleanField(verbose_name=_("conserver la fiche annuaire ?"))
|
||||
|
||||
|
||||
class Department(models.Model):
|
||||
name = models.CharField(max_length = 1023, verbose_name = _('nom du département'))
|
||||
name = models.CharField(max_length=1023, verbose_name=_("nom du département"))
|
||||
|
||||
|
||||
class Phone(models.Model):
|
||||
profile = models.OneToOneField(Profile, on_delete = models.CASCADE, verbose_name = _('profil'))
|
||||
name = models.CharField(max_length = 1023, verbose_name = _('type'))
|
||||
number = models.CharField(max_length = 1023, verbose_name = _('numéro'))
|
||||
profile = models.OneToOneField(
|
||||
Profile, on_delete=models.CASCADE, verbose_name=_("profil")
|
||||
)
|
||||
name = models.CharField(max_length=1023, verbose_name=_("type"))
|
||||
number = models.CharField(max_length=1023, verbose_name=_("numéro"))
|
||||
|
||||
|
||||
class Social(models.Model):
|
||||
profile = models.OneToOneField(Profile, on_delete = models.CASCADE, verbose_name = _('profil'))
|
||||
name = models.CharField(max_length = 1023, verbose_name = _('type'))
|
||||
content = models.CharField(max_length = 1023, verbose_name = _('contenu'))
|
||||
profile = models.OneToOneField(
|
||||
Profile, on_delete=models.CASCADE, verbose_name=_("profil")
|
||||
)
|
||||
name = models.CharField(max_length=1023, verbose_name=_("type"))
|
||||
content = models.CharField(max_length=1023, verbose_name=_("contenu"))
|
||||
|
|
Loading…
Reference in a new issue