# -*- coding: utf-8 -*-

from django.db import models
from django.contrib.auth.models import User


class ErnestoUser(models.Model):
    user = models.OneToOneField(User, on_delete=models.CASCADE, related_name="profile")
    is_ernesto = models.BooleanField("Membre de l'Ernestophone", default=True)
    is_chef = models.BooleanField("Chef Fanfare", default=False)
    phone = models.CharField("Téléphone", max_length=20, blank=True)
    instru = models.CharField("Instrument joué", max_length=40, blank=True)
    slug = models.CharField(max_length=7, editable=False, unique=True)
    doodlename = models.CharField("Nom pour le doodle", max_length=30,
                                  blank=True)
    mails = models.BooleanField("Recevoir les mails", default=True)

    class Meta:
        verbose_name = "Profil Ernestophoniste"
        verbose_name_plural = "Profil Ernestophoniste"

    def __str__(self):
        return self.user.username
# Create your models here.