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

29 lines
821 B
Python

from django.db import models
from gestion.models import ErnestoUser
REP = (
('oui', 'Oui'),
('non', 'Non'),
)
class Prop(models.Model):
nom = models.CharField(max_length=100)
artiste = models.CharField(blank=True, max_length=100)
user = models.ForeignKey(ErnestoUser, verbose_name="Proposé par")
lien = models.URLField(blank=True)
nboui = models.IntegerField(default=0, verbose_name="oui")
nbnon = models.IntegerField(default=0, verbose_name="non")
def __str__(self):
return self.nom
class Meta:
verbose_name="Proposition"
class Reponses(models.Model):
prop = models.ForeignKey(Prop)
part = models.ForeignKey(ErnestoUser)
reponse = models.CharField("Réponse", max_length=20, blank=True, choices=REP)
# Create your models here.