ernestophone.ens.fr/gestion/models.py
2015-07-22 16:08:59 -04:00

23 lines
835 B
Python

# -*- coding: utf-8 -*-
from django.db import models
from django.contrib.auth.models import User
class ErnestoUser(models.Model):
user = models.OneToOneField(User, 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)
class Meta:
verbose_name = "Profil Ernestophoniste"
verbose_name_plural = "Profil Ernestophoniste"
def __unicode__(self):
return unicode(self.user.username)
def __str__(self):
return self.user.username
# Create your models here.