ernestophone.ens.fr/propositions/models.py
Martin Pépin 69b0b13ad3 Nettoyage
- PEP8
- Fichiers inutilisés
2016-07-14 01:58:52 +02:00

31 lines
842 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.