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 tokens
|
||||||
from app.api import sco_api
|
|
||||||
from app.api import test_api
|
|
||||||
from app.api import departements
|
from app.api import departements
|
||||||
from app.api import etudiants
|
from app.api import etudiants
|
||||||
from app.api import formations
|
from app.api import formations
|
||||||
|
@ -15,7 +15,7 @@ from app.scodoc.sco_permissions import Permission
|
|||||||
@token_permission_required(Permission.APIView)
|
@token_permission_required(Permission.APIView)
|
||||||
def departements():
|
def departements():
|
||||||
"""
|
"""
|
||||||
Retourne la liste des ids de départements visibles
|
Retourne la liste des départements visibles
|
||||||
|
|
||||||
Exemple de résultat :
|
Exemple de résultat :
|
||||||
[
|
[
|
||||||
@ -118,31 +118,34 @@ def liste_semestres_courant(dept: str):
|
|||||||
[
|
[
|
||||||
{
|
{
|
||||||
"date_fin": "31/08/2022",
|
"date_fin": "31/08/2022",
|
||||||
"resp_can_edit": false,
|
"resp_can_edit": false,
|
||||||
"dept_id": 1,
|
"dept_id": 1,
|
||||||
"etat": true,
|
"etat": true,
|
||||||
"resp_can_change_ens": true,
|
"resp_can_change_ens": true,
|
||||||
"id": 1,
|
"id": 1,
|
||||||
"modalite": "FI",
|
"modalite": "FI",
|
||||||
"ens_can_edit_eval": false,
|
"ens_can_edit_eval": false,
|
||||||
"formation_id": 1,
|
"formation_id": 1,
|
||||||
"gestion_compensation": false,
|
"gestion_compensation": false,
|
||||||
"elt_sem_apo": null,
|
"elt_sem_apo": null,
|
||||||
"semestre_id": 1,
|
"semestre_id": 1,
|
||||||
"bul_hide_xml": false,
|
"bul_hide_xml": false,
|
||||||
"elt_annee_apo": null,
|
"elt_annee_apo": null,
|
||||||
"titre": "Semestre test",
|
"titre": "Semestre test",
|
||||||
"block_moyennes": false,
|
"block_moyennes": false,
|
||||||
"scodoc7_id": null,
|
"scodoc7_id": null,
|
||||||
"date_debut": "01/09/2021",
|
"date_debut": "01/09/2021",
|
||||||
"gestion_semestrielle": false,
|
"gestion_semestrielle": false,
|
||||||
"bul_bgcolor": "white",
|
"bul_bgcolor": "white",
|
||||||
"formsemestre_id": 1,
|
"formsemestre_id": 1,
|
||||||
"titre_num": "Semestre test semestre 1",
|
"titre_num": "Semestre test semestre 1",
|
||||||
"date_debut_iso": "2021-09-01",
|
"date_debut_iso": "2021-09-01",
|
||||||
"date_fin_iso": "2022-08-31",
|
"date_fin_iso": "2022-08-31",
|
||||||
"responsables": []
|
"responsables": [
|
||||||
"titre_court": BUT MMI
|
12,
|
||||||
|
42
|
||||||
|
],
|
||||||
|
"titre_court": "BUT MMI"
|
||||||
},
|
},
|
||||||
...
|
...
|
||||||
]
|
]
|
||||||
|
@ -120,35 +120,38 @@ def etudiant_formsemestres(etudid: int = None, nip: int = None, ine: int = None)
|
|||||||
|
|
||||||
Exemple de résultat :
|
Exemple de résultat :
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
"date_fin": "31/08/2022",
|
"date_fin": "31/08/2022",
|
||||||
"resp_can_edit": false,
|
"resp_can_edit": false,
|
||||||
"dept_id": 1,
|
"dept_id": 1,
|
||||||
"etat": true,
|
"etat": true,
|
||||||
"resp_can_change_ens": true,
|
"resp_can_change_ens": true,
|
||||||
"id": 1,
|
"id": 1,
|
||||||
"modalite": "FI",
|
"modalite": "FI",
|
||||||
"ens_can_edit_eval": false,
|
"ens_can_edit_eval": false,
|
||||||
"formation_id": 1,
|
"formation_id": 1,
|
||||||
"gestion_compensation": false,
|
"gestion_compensation": false,
|
||||||
"elt_sem_apo": null,
|
"elt_sem_apo": null,
|
||||||
"semestre_id": 1,
|
"semestre_id": 1,
|
||||||
"bul_hide_xml": false,
|
"bul_hide_xml": false,
|
||||||
"elt_annee_apo": null,
|
"elt_annee_apo": null,
|
||||||
"titre": "Semestre test",
|
"titre": "Semestre test",
|
||||||
"block_moyennes": false,
|
"block_moyennes": false,
|
||||||
"scodoc7_id": null,
|
"scodoc7_id": null,
|
||||||
"date_debut": "01/09/2021",
|
"date_debut": "01/09/2021",
|
||||||
"gestion_semestrielle": false,
|
"gestion_semestrielle": false,
|
||||||
"bul_bgcolor": "white",
|
"bul_bgcolor": "white",
|
||||||
"formsemestre_id": 1,
|
"formsemestre_id": 1,
|
||||||
"titre_num": "Semestre test semestre 1",
|
"titre_num": "Semestre test semestre 1",
|
||||||
"date_debut_iso": "2021-09-01",
|
"date_debut_iso": "2021-09-01",
|
||||||
"date_fin_iso": "2022-08-31",
|
"date_fin_iso": "2022-08-31",
|
||||||
"responsables": []
|
"responsables": [
|
||||||
"titre_court": BUT MMI
|
12,
|
||||||
},
|
42
|
||||||
...
|
],
|
||||||
|
"titre_court": "BUT MMI"
|
||||||
|
},
|
||||||
|
...
|
||||||
]
|
]
|
||||||
"""
|
"""
|
||||||
# Récupération de l'étudiant
|
# Récupération de l'étudiant
|
||||||
|
@ -16,7 +16,7 @@ from app.scodoc.sco_permissions import Permission
|
|||||||
@token_permission_required(Permission.APIView)
|
@token_permission_required(Permission.APIView)
|
||||||
def formations_ids():
|
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 ]
|
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
|
Retourne la formation, avec UE, matières, modules
|
||||||
|
|
||||||
formation_id : l'id d'une formation
|
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 :
|
Exemple de résultat :
|
||||||
{
|
{
|
||||||
@ -294,6 +295,7 @@ def moduleimpls_sem(formsemestre_id: int):
|
|||||||
def referentiel_competences(formation_id: int):
|
def referentiel_competences(formation_id: int):
|
||||||
"""
|
"""
|
||||||
Retourne le référentiel de compétences
|
Retourne le référentiel de compétences
|
||||||
|
|
||||||
formation_id : l'id d'une formation
|
formation_id : l'id d'une formation
|
||||||
|
|
||||||
return json, ou null si pas de référentiel associé.
|
return json, ou null si pas de référentiel associé.
|
||||||
|
@ -25,38 +25,41 @@ def formsemestre(formsemestre_id: int):
|
|||||||
|
|
||||||
Exemple de résultat :
|
Exemple de résultat :
|
||||||
{
|
{
|
||||||
"date_fin": "31/08/2022",
|
"date_fin": "31/08/2022",
|
||||||
"resp_can_edit": false,
|
"resp_can_edit": false,
|
||||||
"dept_id": 1,
|
"dept_id": 1,
|
||||||
"etat": true,
|
"etat": true,
|
||||||
"resp_can_change_ens": true,
|
"resp_can_change_ens": true,
|
||||||
"id": 1,
|
"id": 1,
|
||||||
"modalite": "FI",
|
"modalite": "FI",
|
||||||
"ens_can_edit_eval": false,
|
"ens_can_edit_eval": false,
|
||||||
"formation_id": 1,
|
"formation_id": 1,
|
||||||
"gestion_compensation": false,
|
"gestion_compensation": false,
|
||||||
"elt_sem_apo": null,
|
"elt_sem_apo": null,
|
||||||
"semestre_id": 1,
|
"semestre_id": 1,
|
||||||
"bul_hide_xml": false,
|
"bul_hide_xml": false,
|
||||||
"elt_annee_apo": null,
|
"elt_annee_apo": null,
|
||||||
"titre": "Semestre test",
|
"titre": "Semestre test",
|
||||||
"block_moyennes": false,
|
"block_moyennes": false,
|
||||||
"scodoc7_id": null,
|
"scodoc7_id": null,
|
||||||
"date_debut": "01/09/2021",
|
"date_debut": "01/09/2021",
|
||||||
"gestion_semestrielle": false,
|
"gestion_semestrielle": false,
|
||||||
"bul_bgcolor": "white",
|
"bul_bgcolor": "white",
|
||||||
"formsemestre_id": 1,
|
"formsemestre_id": 1,
|
||||||
"titre_num": "Semestre test semestre 1",
|
"titre_num": "Semestre test semestre 1",
|
||||||
"date_debut_iso": "2021-09-01",
|
"date_debut_iso": "2021-09-01",
|
||||||
"date_fin_iso": "2022-08-31",
|
"date_fin_iso": "2022-08-31",
|
||||||
"responsables": [] <<< A DOCUMENTER XXX
|
"responsables": [
|
||||||
}
|
12,
|
||||||
|
42
|
||||||
|
],
|
||||||
|
"titre_court": "BUT MMI"
|
||||||
|
}
|
||||||
"""
|
"""
|
||||||
formsemestre = models.FormSemestre.query.filter_by(
|
formsemestre = models.FormSemestre.query.filter_by(
|
||||||
id=formsemestre_id
|
id=formsemestre_id
|
||||||
).first_or_404()
|
).first_or_404()
|
||||||
data = formsemestre.to_dict()
|
data = formsemestre.to_dict_api()
|
||||||
return jsonify(data)
|
return jsonify(data)
|
||||||
|
|
||||||
|
|
||||||
@ -70,42 +73,47 @@ def formsemestre_apo(etape_apo: str):
|
|||||||
etape_apo : un code étape apogée
|
etape_apo : un code étape apogée
|
||||||
|
|
||||||
Exemple de résultat :
|
Exemple de résultat :
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
"date_fin": "31/08/2022",
|
"date_fin": "31/08/2022",
|
||||||
"resp_can_edit": false,
|
"resp_can_edit": false,
|
||||||
"dept_id": 1,
|
"dept_id": 1,
|
||||||
"etat": true,
|
"etat": true,
|
||||||
"resp_can_change_ens": true,
|
"resp_can_change_ens": true,
|
||||||
"id": 1,
|
"id": 1,
|
||||||
"modalite": "FI",
|
"modalite": "FI",
|
||||||
"ens_can_edit_eval": false,
|
"ens_can_edit_eval": false,
|
||||||
"formation_id": 1,
|
"formation_id": 1,
|
||||||
"gestion_compensation": false,
|
"gestion_compensation": false,
|
||||||
"elt_sem_apo": null,
|
"elt_sem_apo": null,
|
||||||
"semestre_id": 1,
|
"semestre_id": 1,
|
||||||
"bul_hide_xml": false,
|
"bul_hide_xml": false,
|
||||||
"elt_annee_apo": null,
|
"elt_annee_apo": null,
|
||||||
"titre": "Semestre test",
|
"titre": "Semestre test",
|
||||||
"block_moyennes": false,
|
"block_moyennes": false,
|
||||||
"scodoc7_id": null,
|
"scodoc7_id": null,
|
||||||
"date_debut": "01/09/2021",
|
"date_debut": "01/09/2021",
|
||||||
"gestion_semestrielle": false,
|
"gestion_semestrielle": false,
|
||||||
"bul_bgcolor": "white",
|
"bul_bgcolor": "white",
|
||||||
"formsemestre_id": 1,
|
"formsemestre_id": 1,
|
||||||
"titre_num": "Semestre test semestre 1",
|
"titre_num": "Semestre test semestre 1",
|
||||||
"date_debut_iso": "2021-09-01",
|
"date_debut_iso": "2021-09-01",
|
||||||
"date_fin_iso": "2022-08-31",
|
"date_fin_iso": "2022-08-31",
|
||||||
"responsables": []
|
"responsables": [
|
||||||
}, ...
|
12,
|
||||||
]
|
42
|
||||||
|
],
|
||||||
|
"titre_court": "BUT MMI"
|
||||||
|
},
|
||||||
|
...
|
||||||
|
]
|
||||||
"""
|
"""
|
||||||
formsemestres = FormSemestre.query.filter(
|
formsemestres = FormSemestre.query.filter(
|
||||||
FormSemestreEtape.etape_apo == etape_apo,
|
FormSemestreEtape.etape_apo == etape_apo,
|
||||||
FormSemestreEtape.formsemestre_id == FormSemestre.id,
|
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"])
|
@bp.route("/formsemestre/<int:formsemestre_id>/bulletins", methods=["GET"])
|
||||||
@ -348,12 +356,12 @@ def bulletins(formsemestre_id: int):
|
|||||||
# )
|
# )
|
||||||
# @token_auth.login_required
|
# @token_auth.login_required
|
||||||
# @token_permission_required(Permission.APIView)
|
# @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
|
# Retourne la liste des Ues, ressources et SAE d'un semestre
|
||||||
|
#
|
||||||
# formsemestre_id : l'id d'un formsemestre
|
# formsemestre_id : l'id d'un formsemestre
|
||||||
|
#
|
||||||
# Exemple de résultat :
|
# Exemple de résultat :
|
||||||
# {
|
# {
|
||||||
# "ues": [
|
# "ues": [
|
||||||
@ -421,34 +429,34 @@ def bulletins(formsemestre_id: int):
|
|||||||
# ]
|
# ]
|
||||||
# }
|
# }
|
||||||
# """
|
# """
|
||||||
|
#
|
||||||
# formsemestre: FormSemestre = models.FormSemestre.query.filter_by(
|
# formsemestre: FormSemestre = models.FormSemestre.query.filter_by(
|
||||||
# id=formsemestre_id
|
# id=formsemestre_id
|
||||||
# ).first_or_404()
|
# ).first_or_404()
|
||||||
|
#
|
||||||
# ues = formsemestre.query_ues()
|
# ues = formsemestre.query_ues()
|
||||||
|
#
|
||||||
# ues_dict = []
|
# ues_dict = []
|
||||||
# ressources = []
|
# ressources = []
|
||||||
# saes = []
|
# saes = []
|
||||||
|
#
|
||||||
# for ue in ues:
|
# for ue in ues:
|
||||||
# ues_dict.append(ue.to_dict())
|
# ues_dict.append(ue.to_dict())
|
||||||
# ressources = ue.get_ressources()
|
# ressources = ue.get_ressources()
|
||||||
# saes = ue.get_saes()
|
# saes = ue.get_saes()
|
||||||
|
#
|
||||||
# data_ressources = []
|
# data_ressources = []
|
||||||
# for ressource in ressources:
|
# for ressource in ressources:
|
||||||
# data_ressources.append(ressource.to_dict())
|
# data_ressources.append(ressource.to_dict())
|
||||||
|
#
|
||||||
# data_saes = []
|
# data_saes = []
|
||||||
# for sae in saes:
|
# for sae in saes:
|
||||||
# data_saes.append(sae.to_dict())
|
# data_saes.append(sae.to_dict())
|
||||||
|
#
|
||||||
# data = {
|
# data = {
|
||||||
# "ues": ues_dict,
|
# "ues": ues_dict,
|
||||||
# "ressources": data_ressources,
|
# "ressources": data_ressources,
|
||||||
# "saes": data_saes,
|
# "saes": data_saes,
|
||||||
# }
|
# }
|
||||||
|
#
|
||||||
# return data
|
# return data
|
||||||
|
@ -395,7 +395,6 @@ class FormSemestre(db.Model):
|
|||||||
if self.semestre_id == sco_codes_parcours.NO_SEMESTRE_ID:
|
if self.semestre_id == sco_codes_parcours.NO_SEMESTRE_ID:
|
||||||
return self.titre
|
return self.titre
|
||||||
return f"{self.titre} {self.formation.get_parcours().SESSION_NAME} {self.semestre_id}"
|
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:
|
def sem_modalite(self) -> str:
|
||||||
"""Le semestre et la modalité, ex "S2 FI" ou "S3 APP" """
|
"""Le semestre et la modalité, ex "S2 FI" ou "S3 APP" """
|
||||||
|
Loading…
Reference in New Issue
Block a user