forked from ScoDoc/DocScoDoc
WIP: misc bonus sport
This commit is contained in:
parent
4daa9e8945
commit
4e1811e609
@ -35,7 +35,7 @@ class ResultatsSemestre:
|
||||
)
|
||||
|
||||
def __init__(self, formsemestre: FormSemestre):
|
||||
self.formsemestre = formsemestre
|
||||
self.formsemestre: FormSemestre = formsemestre
|
||||
# BUT ou standard ? (apc == "approche par compétences")
|
||||
self.is_apc = formsemestre.formation.is_apc()
|
||||
# Attributs "virtuels", définis dans les sous-classes
|
||||
@ -79,10 +79,17 @@ class ResultatsSemestre:
|
||||
"dict { etudid : indice dans les inscrits }"
|
||||
return {e.id: idx for idx, e in enumerate(self.etuds)}
|
||||
|
||||
@cached_property
|
||||
def etuds_dict(self):
|
||||
"dict { etudid : Identite } inscrits au semestre, sans les démissionnaires"
|
||||
return {etud.id: etud for etud in self.etuds}
|
||||
|
||||
@cached_property
|
||||
def ues(self) -> list:
|
||||
"Liste des UE du semestre"
|
||||
return self.formsemestre.query_ues().all()
|
||||
"""Liste des UEs du semestre
|
||||
(indices des DataFrames)
|
||||
"""
|
||||
return self.formsemestre.query_ues(with_sport=True).all()
|
||||
|
||||
@cached_property
|
||||
def modimpls(self):
|
||||
@ -191,9 +198,7 @@ class NotesTableCompat(ResultatsSemestre):
|
||||
Résultat: liste de dicts { champs UE U stats moyenne UE }
|
||||
"""
|
||||
ues = []
|
||||
for ue in self.ues:
|
||||
if filter_sport and ue.type == UE_SPORT:
|
||||
continue
|
||||
for ue in self.formsemestre.query_ues(with_sport=not filter_sport):
|
||||
d = ue.to_dict()
|
||||
d.update(StatsMoyenne(self.etud_moy_ue[ue.id]).to_dict())
|
||||
ues.append(d)
|
||||
|
@ -12,6 +12,7 @@ from app import db
|
||||
from app import models
|
||||
|
||||
from app.scodoc import notesdb as ndb
|
||||
from app.scodoc.sco_bac import Baccalaureat
|
||||
|
||||
|
||||
class Identite(db.Model):
|
||||
@ -50,6 +51,8 @@ class Identite(db.Model):
|
||||
#
|
||||
adresses = db.relationship("Adresse", lazy="dynamic", backref="etud")
|
||||
billets = db.relationship("BilletAbsence", backref="etudiant", lazy="dynamic")
|
||||
# one-to-one relation:
|
||||
admission = db.relationship("Admission", backref="identite", lazy="dynamic")
|
||||
|
||||
def __repr__(self):
|
||||
return f"<Etud {self.id} {self.nom} {self.prenom}>"
|
||||
@ -294,6 +297,10 @@ class Admission(db.Model):
|
||||
# classement (1..Ngr) par le jury dans le groupe APB
|
||||
apb_classement_gr = db.Column(db.Integer)
|
||||
|
||||
def get_bac(self) -> Baccalaureat:
|
||||
"Le bac. utiliser bac.abbrev() pour avoir une chaine de caractères."
|
||||
return Baccalaureat(self.bac, specialite=self.specialite)
|
||||
|
||||
|
||||
# Suivi scolarité / débouchés
|
||||
class ItemSuivi(db.Model):
|
||||
|
@ -130,7 +130,7 @@ BACS_SSP = {(t[0], t[1]): t[2:] for t in _BACS}
|
||||
BACS_S = {t[0]: t[2:] for t in _BACS}
|
||||
|
||||
|
||||
class Baccalaureat(object):
|
||||
class Baccalaureat:
|
||||
def __init__(self, bac, specialite=""):
|
||||
self.bac = bac
|
||||
self.specialite = specialite
|
||||
|
@ -295,7 +295,7 @@ div.logo-logo img {
|
||||
margin-top: -10px;
|
||||
width: 128px;
|
||||
padding-right: 5px;
|
||||
margin-left: -30px;
|
||||
margin-left: -75px;
|
||||
}
|
||||
div.sidebar-bottom {
|
||||
margin-top: 10px;
|
||||
@ -1671,7 +1671,10 @@ li.notes_ue_list {
|
||||
margin-top: 9px;
|
||||
list-style-type: none;
|
||||
}
|
||||
|
||||
span.ue_type_1 {
|
||||
color: green;
|
||||
font-weight: bold;
|
||||
}
|
||||
span.ue_code {
|
||||
font-family: Courier, monospace;
|
||||
font-weight: normal;
|
||||
|
@ -29,9 +29,11 @@
|
||||
scodoc_dept=g.scodoc_dept, ue_id=ue.id)
|
||||
}}">{% if editable and not ue.modules.count() %}{{icons.delete|safe}}{% else %}{{icons.delete_disabled|safe}}{% endif %}</a>
|
||||
|
||||
<span class="ue_type_{{ue.type}}">
|
||||
<b>{{ue.acronyme}}</b> <a class="discretelink" href="{{
|
||||
url_for('notes.ue_infos', scodoc_dept=g.scodoc_dept, ue_id=ue.id)}}"
|
||||
>{{ue.titre}}</a>
|
||||
</span>
|
||||
|
||||
{% if editable and not ue.is_locked() %}
|
||||
<a class="stdlink" href="{{ url_for('notes.ue_edit',
|
||||
|
Loading…
Reference in New Issue
Block a user