From 799a62798ca052ff754d847357982cb7ebf4934d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20P=C3=A9pin?= Date: Mon, 18 Feb 2019 21:47:03 +0100 Subject: [PATCH] black --- fiches/models.py | 49 ++++++++++++++++++++++++++++-------------------- 1 file changed, 29 insertions(+), 20 deletions(-) diff --git a/fiches/models.py b/fiches/models.py index 60de0a6..e44bcb4 100644 --- a/fiches/models.py +++ b/fiches/models.py @@ -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')) \ No newline at end of file + 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"))