Added mails & adresse

This commit is contained in:
Ju Luiselli 2020-01-09 00:07:59 +01:00
parent 20c1c5581d
commit 39a69c4d95
2 changed files with 27 additions and 4 deletions

View file

@ -3,9 +3,14 @@ from fiches.models import Profile
from fiches.models import Department
from fiches.models import Phone
from fiches.models import Social
from fiches.models import Mail
from fiches.models import Address
# Register your models here.
admin.site.register(Profile)
admin.site.register(Department)
admin.site.register(Phone)
admin.site.register(Social)
admin.site.register(Social)
admin.site.register(Mail)
admin.site.register(Address)

View file

@ -31,7 +31,7 @@ class Profile(models.Model):
class Department(models.Model):
name = models.CharField(max_length=1023, verbose_name=_("nom du département"))
name = models.CharField(max_length=255, verbose_name=_("nom du département"))
def __str__(self):
return self.name
@ -40,7 +40,7 @@ class Phone(models.Model):
profile = models.ForeignKey(
Profile, on_delete=models.CASCADE, verbose_name=_("profil")
)
name = models.CharField(max_length=1023, verbose_name=_("type"))
name = models.CharField(max_length=255, verbose_name=_("type"))
number = models.CharField(max_length=1023, verbose_name=_("numéro"))
def __str__(self):
return "{} : {}".format(self.name, self.number)
@ -50,7 +50,25 @@ class Social(models.Model):
profile = models.ForeignKey(
Profile, on_delete=models.CASCADE, verbose_name=_("profil")
)
name = models.CharField(max_length=1023, verbose_name=_("type"))
name = models.CharField(max_length=255, verbose_name=_("type"))
content = models.CharField(max_length=1023, verbose_name=_("contenu"))
def __str__(self):
return "{} : {}".format(self.name, self.content)
class Mail(models.Model):
profile = models.ForeignKey(
Profile, on_delete=models.CASCADE, verbose_name=_("profil")
)
name = models.CharField(max_length=255, verbose_name=_("type"))
mail = models.CharField(max_length=1023, verbose_name=_("adresse mail"))
def __str__(self):
return "{} : {}".format(self.name, self.mail)
class Address(models.Model):
profile = models.ForeignKey(
Profile, on_delete=models.CASCADE, verbose_name=_("profil")
)
name = models.CharField(max_length=255, verbose_name=_("type"))
content = models.CharField(max_length=1023, verbose_name=_("adresse"))
def __str__(self):
return "{} : {}".format(self.name, self.content)