forked from ScoDoc/ScoDoc
Compare commits
3 Commits
8c821388a4
...
2cc1ab13d3
Author | SHA1 | Date | |
---|---|---|---|
|
2cc1ab13d3 | ||
|
5caa0261d6 | ||
22b0e29d72 |
@ -22,8 +22,6 @@ def requested_format(default_format="json", allowed_formats=None):
|
||||
|
||||
|
||||
from app.api import tokens
|
||||
from app.api import sco_api
|
||||
from app.api import test_api
|
||||
from app.api import departements
|
||||
from app.api import etudiants
|
||||
from app.api import formations
|
||||
|
@ -15,7 +15,7 @@ from app.scodoc.sco_permissions import Permission
|
||||
@token_permission_required(Permission.APIView)
|
||||
def departements():
|
||||
"""
|
||||
Retourne la liste des ids de départements visibles
|
||||
Retourne la liste des départements visibles
|
||||
|
||||
Exemple de résultat :
|
||||
[
|
||||
@ -141,8 +141,11 @@ def liste_semestres_courant(dept: str):
|
||||
"titre_num": "Semestre test semestre 1",
|
||||
"date_debut_iso": "2021-09-01",
|
||||
"date_fin_iso": "2022-08-31",
|
||||
"responsables": []
|
||||
"titre_court": BUT MMI
|
||||
"responsables": [
|
||||
12,
|
||||
42
|
||||
],
|
||||
"titre_court": "BUT MMI"
|
||||
},
|
||||
...
|
||||
]
|
||||
|
@ -145,8 +145,11 @@ def etudiant_formsemestres(etudid: int = None, nip: int = None, ine: int = None)
|
||||
"titre_num": "Semestre test semestre 1",
|
||||
"date_debut_iso": "2021-09-01",
|
||||
"date_fin_iso": "2022-08-31",
|
||||
"responsables": []
|
||||
"titre_court": BUT MMI
|
||||
"responsables": [
|
||||
12,
|
||||
42
|
||||
],
|
||||
"titre_court": "BUT MMI"
|
||||
},
|
||||
...
|
||||
]
|
||||
|
@ -16,7 +16,7 @@ from app.scodoc.sco_permissions import Permission
|
||||
@token_permission_required(Permission.APIView)
|
||||
def formations_ids():
|
||||
"""
|
||||
Retourne la liste de toutes les formations (tous départements)
|
||||
Retourne la liste de toutes les id de formations (tous départements)
|
||||
|
||||
Exemple de résultat : [ 17, 99, 32 ]
|
||||
"""
|
||||
@ -79,6 +79,7 @@ def formation_export_by_formation_id(formation_id: int, export_ids=False):
|
||||
Retourne la formation, avec UE, matières, modules
|
||||
|
||||
formation_id : l'id d'une formation
|
||||
export_ids : True ou False, si l'on veut ou non exporter les ids
|
||||
|
||||
Exemple de résultat :
|
||||
{
|
||||
@ -294,6 +295,7 @@ def moduleimpls_sem(formsemestre_id: int):
|
||||
def referentiel_competences(formation_id: int):
|
||||
"""
|
||||
Retourne le référentiel de compétences
|
||||
|
||||
formation_id : l'id d'une formation
|
||||
|
||||
return json, ou null si pas de référentiel associé.
|
||||
|
@ -49,14 +49,17 @@ def formsemestre(formsemestre_id: int):
|
||||
"titre_num": "Semestre test semestre 1",
|
||||
"date_debut_iso": "2021-09-01",
|
||||
"date_fin_iso": "2022-08-31",
|
||||
"responsables": [] <<< A DOCUMENTER XXX
|
||||
"responsables": [
|
||||
12,
|
||||
42
|
||||
],
|
||||
"titre_court": "BUT MMI"
|
||||
}
|
||||
|
||||
"""
|
||||
formsemestre = models.FormSemestre.query.filter_by(
|
||||
id=formsemestre_id
|
||||
).first_or_404()
|
||||
data = formsemestre.to_dict()
|
||||
data = formsemestre.to_dict_api()
|
||||
return jsonify(data)
|
||||
|
||||
|
||||
@ -96,8 +99,13 @@ def formsemestre_apo(etape_apo: str):
|
||||
"titre_num": "Semestre test semestre 1",
|
||||
"date_debut_iso": "2021-09-01",
|
||||
"date_fin_iso": "2022-08-31",
|
||||
"responsables": []
|
||||
}, ...
|
||||
"responsables": [
|
||||
12,
|
||||
42
|
||||
],
|
||||
"titre_court": "BUT MMI"
|
||||
},
|
||||
...
|
||||
]
|
||||
"""
|
||||
formsemestres = FormSemestre.query.filter(
|
||||
@ -105,7 +113,7 @@ def formsemestre_apo(etape_apo: str):
|
||||
FormSemestreEtape.formsemestre_id == FormSemestre.id,
|
||||
)
|
||||
|
||||
return jsonify([formsemestre.to_dict() for formsemestre in formsemestres])
|
||||
return jsonify([formsemestre.to_dict_api() for formsemestre in formsemestres])
|
||||
|
||||
|
||||
@bp.route("/formsemestre/<int:formsemestre_id>/bulletins", methods=["GET"])
|
||||
@ -348,12 +356,12 @@ def bulletins(formsemestre_id: int):
|
||||
# )
|
||||
# @token_auth.login_required
|
||||
# @token_permission_required(Permission.APIView)
|
||||
# def semestre_index(formsemestre_id: int): # XXX nom bizarre ??
|
||||
# def programme(formsemestre_id: int):
|
||||
# """
|
||||
# Retourne la liste des Ues, ressources et SAE d'un semestre
|
||||
|
||||
#
|
||||
# formsemestre_id : l'id d'un formsemestre
|
||||
|
||||
#
|
||||
# Exemple de résultat :
|
||||
# {
|
||||
# "ues": [
|
||||
@ -421,34 +429,34 @@ def bulletins(formsemestre_id: int):
|
||||
# ]
|
||||
# }
|
||||
# """
|
||||
|
||||
#
|
||||
# formsemestre: FormSemestre = models.FormSemestre.query.filter_by(
|
||||
# id=formsemestre_id
|
||||
# ).first_or_404()
|
||||
|
||||
#
|
||||
# ues = formsemestre.query_ues()
|
||||
|
||||
#
|
||||
# ues_dict = []
|
||||
# ressources = []
|
||||
# saes = []
|
||||
|
||||
#
|
||||
# for ue in ues:
|
||||
# ues_dict.append(ue.to_dict())
|
||||
# ressources = ue.get_ressources()
|
||||
# saes = ue.get_saes()
|
||||
|
||||
#
|
||||
# data_ressources = []
|
||||
# for ressource in ressources:
|
||||
# data_ressources.append(ressource.to_dict())
|
||||
|
||||
#
|
||||
# data_saes = []
|
||||
# for sae in saes:
|
||||
# data_saes.append(sae.to_dict())
|
||||
|
||||
#
|
||||
# data = {
|
||||
# "ues": ues_dict,
|
||||
# "ressources": data_ressources,
|
||||
# "saes": data_saes,
|
||||
# }
|
||||
|
||||
#
|
||||
# return data
|
||||
|
@ -395,7 +395,6 @@ class FormSemestre(db.Model):
|
||||
if self.semestre_id == sco_codes_parcours.NO_SEMESTRE_ID:
|
||||
return self.titre
|
||||
return f"{self.titre} {self.formation.get_parcours().SESSION_NAME} {self.semestre_id}"
|
||||
# return f"{self.formation.acronyme} S{self.semestre_id}"
|
||||
|
||||
def sem_modalite(self) -> str:
|
||||
"""Le semestre et la modalité, ex "S2 FI" ou "S3 APP" """
|
||||
|
Loading…
Reference in New Issue
Block a user