ernestophone.ens.fr/gestion/models.py

26 lines
986 B
Python
Raw Normal View History

2015-03-17 19:03:51 +01:00
# -*- 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)
2015-07-22 22:08:59 +02:00
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)
2015-03-17 19:03:51 +01:00
class Meta:
verbose_name = "Profil Ernestophoniste"
2015-07-22 22:08:59 +02:00
verbose_name_plural = "Profil Ernestophoniste"
2015-03-17 19:03:51 +01:00
def __unicode__(self):
return unicode(self.user.username)
2015-07-22 22:08:59 +02:00
def __str__(self):
return self.user.username
2015-03-17 19:03:51 +01:00
# Create your models here.