forked from eric.li/EditionPN
78 lines
2.8 KiB
Python
78 lines
2.8 KiB
Python
from app import db
|
|
|
|
Ressources_ACs = db.Table("Ressources_ACs",
|
|
db.Column("Ressource_code", db.String(4), db.ForeignKey("ressource.code")),
|
|
db.Column("AC_code", db.String(6), db.ForeignKey("AC.code"))
|
|
)
|
|
|
|
Ressources_SAEs = db.Table("Ressources_SAEs",
|
|
db.Column("Ressource_code", db.String(4), db.ForeignKey("ressource.code")),
|
|
db.Column("SAE_code", db.String(5), db.ForeignKey("SAE.code"))
|
|
)
|
|
|
|
SAEs_ACs = db.Table("SAEs_ACs",
|
|
db.Column("SAE_code", db.String(5), db.ForeignKey("SAE.code")),
|
|
db.Column("AC_code", db.String(6), db.ForeignKey("AC.code"))
|
|
)
|
|
|
|
class PN(db.Model):
|
|
code = db.Column(db.String(3), primary_key = True)
|
|
nom = db.Column(db.String(255))
|
|
diminutif = db.Column(db.String(30))
|
|
description = db.Column(db.Text())
|
|
type = db.Column(db.String(1))
|
|
|
|
def __repr__(self):
|
|
return "<PN {}>".format(self.code)
|
|
|
|
class AC(db.Model):
|
|
code = db.Column(db.String(6), primary_key = True)
|
|
titre = db.Column(db.String(255))
|
|
saes = db.relationship("SAE", secondary=SAEs_ACs, cascade="all, delete", lazy=False, backref=db.backref("acs", lazy=False))
|
|
ressources = db.relationship("Ressource", secondary=Ressources_ACs, cascade="all, delete", lazy=False, backref=db.backref("acs", lazy=False))
|
|
|
|
def __repr__(self):
|
|
return "<AC {}>".format(self.code)
|
|
|
|
class SAE(db.Model):
|
|
code = db.Column(db.String(5), primary_key = True)
|
|
titre = db.Column(db.String(255))
|
|
semestre = db.Column(db.String(255))
|
|
heures_encadrees = db.Column(db.String(3))
|
|
heures_tp = db.Column(db.String(3))
|
|
projet = db.Column(db.String(3))
|
|
description = db.Column(db.Text())
|
|
coef = db.Column(db.String(255))
|
|
ressources = db.relationship("Ressource", secondary=Ressources_SAEs, cascade="all, delete", lazy=False, backref=db.backref("saes", lazy=False))
|
|
livrables = db.Column(db.Text())
|
|
motscles = db.Column(db.String(255))
|
|
|
|
def __repr__(self):
|
|
return "<SAE {}>".format(self.code)
|
|
|
|
class Ressource(db.Model):
|
|
code = db.Column(db.String(4), primary_key = True)
|
|
nom = db.Column(db.String(255))
|
|
semestre = db.Column(db.String(255))
|
|
heures_formation = db.Column(db.String(3))
|
|
heures_tp = db.Column(db.String(3))
|
|
coef = db.Column(db.String(255))
|
|
prerequis = db.Column(db.String(255))
|
|
contexte = db.Column(db.Text())
|
|
contenu = db.Column(db.Text())
|
|
motscles = db.Column(db.String(255))
|
|
|
|
def __repr__(self):
|
|
return "<Ressource {}>".format(self.code)
|
|
|
|
class Competence(db.Model):
|
|
code = db.Column(db.String(3), primary_key = True)
|
|
nom = db.Column(db.String(255))
|
|
diminutif = db.Column(db.String(30))
|
|
description = db.Column(db.Text())
|
|
composantes = db.Column(db.Text())
|
|
situations = db.Column(db.Text())
|
|
niveaux = db.Column(db.Text())
|
|
|
|
def __repr__(self):
|
|
return "<Compétence {}>".format(self.code) |