forked from ScoDoc/ScoDoc
modif export json (retours Seb)
This commit is contained in:
parent
6627a9c6b2
commit
958539977a
@ -56,6 +56,7 @@ class ApcReferentielCompetences(db.Model, XMLModel):
|
|||||||
lazy="dynamic",
|
lazy="dynamic",
|
||||||
cascade="all, delete-orphan",
|
cascade="all, delete-orphan",
|
||||||
)
|
)
|
||||||
|
formations = db.relationship("Formation", backref="referentiel_competence")
|
||||||
|
|
||||||
def to_dict(self):
|
def to_dict(self):
|
||||||
"""Représentation complète du ref. de comp.
|
"""Représentation complète du ref. de comp.
|
||||||
@ -66,7 +67,9 @@ class ApcReferentielCompetences(db.Model, XMLModel):
|
|||||||
"specialite": self.specialite,
|
"specialite": self.specialite,
|
||||||
"specialite_long": self.specialite_long,
|
"specialite_long": self.specialite_long,
|
||||||
"type_titre": self.type_titre,
|
"type_titre": self.type_titre,
|
||||||
"scodoc_date_loaded": self.scodoc_date_loaded.isoformat() + "Z",
|
"scodoc_date_loaded": self.scodoc_date_loaded.isoformat() + "Z"
|
||||||
|
if self.scodoc_date_loaded
|
||||||
|
else "",
|
||||||
"scodoc_orig_filename": self.scodoc_orig_filename,
|
"scodoc_orig_filename": self.scodoc_orig_filename,
|
||||||
"competences": {x.titre: x.to_dict() for x in self.competences},
|
"competences": {x.titre: x.to_dict() for x in self.competences},
|
||||||
"parcours": {x.code: x.to_dict() for x in self.parcours},
|
"parcours": {x.code: x.to_dict() for x in self.parcours},
|
||||||
@ -188,7 +191,7 @@ class ApcAppCritique(db.Model, XMLModel):
|
|||||||
)
|
)
|
||||||
|
|
||||||
def to_dict(self):
|
def to_dict(self):
|
||||||
return {"code": self.code, "libelle": self.libelle}
|
return {"libelle": self.libelle}
|
||||||
|
|
||||||
def get_label(self):
|
def get_label(self):
|
||||||
return self.code + " - " + self.titre
|
return self.code + " - " + self.titre
|
||||||
@ -243,7 +246,7 @@ class ApcAnneeParcours(db.Model, XMLModel):
|
|||||||
return {
|
return {
|
||||||
"ordre": self.ordre,
|
"ordre": self.ordre,
|
||||||
"competences": {
|
"competences": {
|
||||||
x.competence.titre: {"niveau": x.niveau, "titre": x.competence.titre}
|
x.competence.titre: {"niveau": x.niveau}
|
||||||
for x in self.niveaux_competences
|
for x in self.niveaux_competences
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user