forked from ScoDoc/ScoDoc
Compare commits
4 Commits
f3ceaff307
...
499d42a912
Author | SHA1 | Date |
---|---|---|
Jean-Marie Place | 499d42a912 | |
Emmanuel Viennet | ead32c8a06 | |
Emmanuel Viennet | dc375f1a89 | |
Emmanuel Viennet | cab72caebe |
|
@ -150,6 +150,14 @@ def justificatifs_dept(dept_id: int = None, with_query: bool = False):
|
|||
|
||||
@bp.route("/justificatif/<int:etudid>/create", methods=["POST"])
|
||||
@api_web_bp.route("/justificatif/<int:etudid>/create", methods=["POST"])
|
||||
@bp.route("/justificatif/etudid/<etudid>/create", methods=["POST"])
|
||||
@api_web_bp.route("/justificatif/etudid/<etudid>/create", methods=["POST"])
|
||||
# nip
|
||||
@bp.route("/justificatif/nip/<nip>/create", methods=["POST"])
|
||||
@api_web_bp.route("/justificatif/nip/<nip>/create", methods=["POST"])
|
||||
# ine
|
||||
@bp.route("/justificatif/ine/<ine>/create", methods=["POST"])
|
||||
@api_web_bp.route("/justificatif/ine/<ine>/create", methods=["POST"])
|
||||
@scodoc
|
||||
@login_required
|
||||
@as_json
|
||||
|
|
|
@ -59,6 +59,10 @@ class Assiduite(db.Model):
|
|||
|
||||
est_just = db.Column(db.Boolean, server_default="false", nullable=False)
|
||||
|
||||
# Déclare la relation "joined" car on va très souvent vouloir récupérer
|
||||
# l'étudiant en même tant que l'assiduité (perf.: évite nouvelle requete SQL)
|
||||
etudiant = db.relationship("Identite", back_populates="assiduites", lazy="joined")
|
||||
|
||||
def to_dict(self, format_api=True) -> dict:
|
||||
"""Retourne la représentation json de l'assiduité"""
|
||||
etat = self.etat
|
||||
|
@ -75,6 +79,7 @@ class Assiduite(db.Model):
|
|||
data = {
|
||||
"assiduite_id": self.id,
|
||||
"etudid": self.etudid,
|
||||
"code_nip": self.etudiant.code_nip,
|
||||
"moduleimpl_id": self.moduleimpl_id,
|
||||
"date_debut": self.date_debut,
|
||||
"date_fin": self.date_fin,
|
||||
|
@ -202,6 +207,9 @@ class Justificatif(db.Model):
|
|||
# Archive_id -> sco_archives_justificatifs.py
|
||||
fichier = db.Column(db.Text())
|
||||
|
||||
# XXX Faudrait-il le déclarer "joined" comme dans Assiduite ?
|
||||
etudiant = db.relationship("Identite", back_populates="justificatifs")
|
||||
|
||||
def to_dict(self, format_api: bool = False) -> dict:
|
||||
"""transformation de l'objet en dictionnaire sérialisable"""
|
||||
|
||||
|
|
|
@ -74,8 +74,10 @@ class Identite(db.Model):
|
|||
)
|
||||
|
||||
# Relations avec les assiduites et les justificatifs
|
||||
assiduites = db.relationship("Assiduite", backref="etudiant", lazy="dynamic")
|
||||
justificatifs = db.relationship("Justificatif", backref="etudiant", lazy="dynamic")
|
||||
assiduites = db.relationship("Assiduite", back_populates="etudiant", lazy="dynamic")
|
||||
justificatifs = db.relationship(
|
||||
"Justificatif", back_populates="etudiant", lazy="dynamic"
|
||||
)
|
||||
|
||||
def __repr__(self):
|
||||
return (
|
||||
|
|
|
@ -376,8 +376,12 @@ class releveBUT extends HTMLElement {
|
|||
}</div>
|
||||
<div class=info>`;
|
||||
if (!dataUE.date_capitalisation) {
|
||||
output += ` Bonus : ${dataUE.bonus || 0} -
|
||||
Malus : ${dataUE.malus || 0}`;
|
||||
output += ` Bonus : ${dataUE.bonus || 0} - `;
|
||||
if(dataUE.malus >= 0) {
|
||||
output += `Malus : ${dataUE.malus || 0}`;
|
||||
} else {
|
||||
output += `Bonus complémentaire : ${-dataUE.malus || 0}`;
|
||||
}
|
||||
} else {
|
||||
output += ` le ${this.ISOToDate(
|
||||
dataUE.date_capitalisation.split("T")[0]
|
||||
|
|
|
@ -24,6 +24,7 @@ MODULE = 1
|
|||
ASSIDUITES_FIELDS = {
|
||||
"assiduite_id": int,
|
||||
"etudid": int,
|
||||
"code_nip": str,
|
||||
"moduleimpl_id": int,
|
||||
"date_debut": str,
|
||||
"date_fin": str,
|
||||
|
|
|
@ -36,9 +36,7 @@ from tests.api.tools_test_api import (
|
|||
SAISIE_NOTES_FIELDS,
|
||||
FORMSEMESTRE_ETUD_FIELDS,
|
||||
FSEM_FIELDS,
|
||||
FSEM_FIELDS,
|
||||
UE_FIELDS,
|
||||
MODULE_FIELDS,
|
||||
FORMSEMESTRE_BULLETINS_FIELDS,
|
||||
FORMSEMESTRE_BULLETINS_ETU_FIELDS,
|
||||
FORMSEMESTRE_BULLETINS_FORMATION_FIELDS,
|
||||
|
|
Loading…
Reference in New Issue