class ADMIN(UserMixin, db.Model): idAdmin = db.Column(db.Integer, primary_key=True) nomAdmin = db.Column(db.String(100)) mdpAdmin = db.Column(db.String(100)) def get_id(self): return self.idAdmin
class PHOTO(db.Model): idPhoto = db.Column(db.Integer, primary_key=True, autoincrement=True) idT = db.Column(db.Integer, db.ForeignKey("TOURNOI.idT"), primary_key=True, autoincrement=False) nomPhoto = db.Column(db.String(60)) descPhoto = db.Column(db.String(100)) datePhoto = db.Column(db.DateTime, default=datetime.datetime.now())
class PARTIE(db.Model): idPartie = db.Column(db.Integer, primary_key=True, autoincrement=True) idT = db.Column(db.Integer, db.ForeignKey("TOURNOI.idT"), primary_key=True, autoincrement=False) cartePartie = db.Column(db.String(100)) datePartie = db.Column(db.DateTime, default=datetime.datetime.now()) etatPartie = db.Column(db.Integer, default=0)
class EQUIPE(db.Model): idE = db.Column(db.Integer, primary_key = True, autoincrement=True) idT = db.Column(db.Integer,db.ForeignKey("TOURNOI.idT"),primary_key = True, autoincrement=False) etatE = db.Column(db.Integer) points = db.Column(db.Integer, default = 0) nbParticipant = db.Column(db.Integer) idChefE = db.Column(db.Integer, db.ForeignKey("PARTICIPANT.idP")) nomE = db.Column(db.String(100)) machineE = db.Column(db.String(100))
class TOURNOI(db.Model): idT = db.Column(db.Integer, primary_key=True) idAdmin = db.Column(db.Integer, db.ForeignKey("ADMIN.idAdmin")) dateT = db.Column(db.Date) dateFinT = db.Column(db.Date) intituleT = db.Column(db.String(100)) descT = db.Column(db.String(100)) etatT = db.Column(db.Integer) nbEquipe = db.Column(db.Integer) nbParticipantsMax = db.Column(db.Integer) disciplineT = db.Column(db.String(30)) stream = db.Column(db.Text) lieuT = db.Column(db.String(30)) logoT = db.Column(db.Text) cheminMaps = db.Column(db.String(200)) cheminScript = db.Column(db.String(200)) dossierPhotos = db.Column(db.String(200)) dossierReglement = db.Column(db.String(200)) nbTours = db.Column(db.Integer, default=0)
class CONSTITUER(db.Model): idP = db.Column(db.Integer, db.ForeignKey("PARTICIPANT.idP"), primary_key=True) idE = db.Column(db.Integer, db.ForeignKey("EQUIPE.idE"), primary_key=True)
class REGLE(db.Model): idT = db.Column(db.Integer, db.ForeignKey("TOURNOI.idT"), primary_key=True) nomFic = db.Column(db.String(100))
class PARTICIPERPARTIE(db.Model): idE = db.Column(db.Integer, db.ForeignKey("EQUIPE.idE"), primary_key=True) idPartie = db.Column(db.Integer, db.ForeignKey("PARTIE.idPartie"), primary_key=True) idT = db.Column(db.Integer, db.ForeignKey("TOURNOI.idT"), primary_key=True)
class PARTICIPANT(db.Model): idP = db.Column(db.Integer, primary_key = True) nomP = db.Column(db.String(100)) prenomP = db.Column(db.String(100)) mailP = db.Column(db.String(100))