From fe7115650ff2e5c60f6faf7270e76c809a7bd9db Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Wed, 13 Jul 2022 16:41:36 +0200 Subject: [PATCH] =?UTF-8?q?Int=C3=A9gration=20des=20travaux=20de=20L=C3=A9?= =?UTF-8?q?onard.=20Non=20test=C3=A9,=20=C3=A0=20relire/compl=C3=A9ter/v?= =?UTF-8?q?=C3=A9rifier.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/__init__.py | 1 - app/api/debug.py | 31 ----------- app/models/absences.py | 9 ---- app/models/but_refcomp.py | 99 ------------------------------------ app/models/formsemestre.py | 5 -- app/models/notes.py | 8 --- app/scodoc/sco_apogee_csv.py | 2 - 7 files changed, 155 deletions(-) delete mode 100644 app/api/debug.py diff --git a/app/api/__init__.py b/app/api/__init__.py index c51421f0..9be4d3b6 100644 --- a/app/api/__init__.py +++ b/app/api/__init__.py @@ -31,4 +31,3 @@ from app.api import evaluations from app.api import jury from app.api import absences from app.api import logos -from app.api import debug diff --git a/app/api/debug.py b/app/api/debug.py deleted file mode 100644 index c2ed2eb5..00000000 --- a/app/api/debug.py +++ /dev/null @@ -1,31 +0,0 @@ -# -*- mode: python -*- -# -*- coding: utf-8 -*- - -############################################################################## -# -# Gestion scolarite IUT -# -# Copyright (c) 1999 - 2022 Emmanuel Viennet. All rights reserved. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# Emmanuel Viennet emmanuel.viennet@viennet.net -# -############################################################################## - -""" -!!! ATTENTION !!! -Fichier a utilisé uniquement à des fins de debug -""" diff --git a/app/models/absences.py b/app/models/absences.py index 881a81e3..405ea6bf 100644 --- a/app/models/absences.py +++ b/app/models/absences.py @@ -29,15 +29,6 @@ class Absence(db.Model): # XXX TODO: contrainte ajoutée: vérifier suppression du module # (mettre à NULL sans supprimer) - def __init__(self, id, etudid, jour, estabs, estjust, matin, description): - self.id = id - self.etudid = etudid - self.jour = jour - self.estabs = estabs - self.estjust = estjust - self.matin = matin - self.description = description - def to_dict(self): data = { "id": self.id, diff --git a/app/models/but_refcomp.py b/app/models/but_refcomp.py index 62710eee..0a4afd07 100644 --- a/app/models/but_refcomp.py +++ b/app/models/but_refcomp.py @@ -83,40 +83,6 @@ class ApcReferentielCompetences(db.Model, XMLModel): ) formations = db.relationship("Formation", backref="referentiel_competence") - def __init__( - self, - id, - dept_id, - annexe, - specialite, - specialite_long, - type_titre, - type_structure, - type_departement, - version_orebut, - _xml_attribs, - #scodoc_date_loaded, - scodoc_orig_filename, - # competences, - # parcours, - # formations, - ): - self.id = id - self.dept_id = dept_id - self.annexe = annexe - self.specialite = specialite - self.specialite_long = specialite_long - self.type_titre = type_titre - self.type_structure = type_structure - self.type_departement = type_departement - self.version_orebut = version_orebut - self._xml_attribs = _xml_attribs - #self.scodoc_date_loaded = scodoc_date_loaded - self.scodoc_orig_filename = scodoc_orig_filename - # self.competences = competences - # self.parcours = parcours - # self.formations = formations - def __repr__(self): return f"" @@ -225,32 +191,6 @@ class ApcCompetence(db.Model, XMLModel): cascade="all, delete-orphan", ) - def __init__( - self, - id, - referentiel_id, - id_orebut, - titre, - titre_long, - couleur, - numero, - _xml_attribs, - situations, - composantes_essentielles, - niveaux, - ): - self.id = id - self.referentiel_id = referentiel_id - self.id_orebut = id_orebut - self.titre = titre - self.titre_long = titre_long - self.couleur = couleur - self.numero = numero - self._xml_attribs = _xml_attribs - self.situations = situations - self.composantes_essentielles = composantes_essentielles - self.niveaux = niveaux - def __repr__(self): return f"" @@ -288,12 +228,6 @@ class ApcSituationPro(db.Model, XMLModel): ) libelle = db.Column(db.Text(), nullable=False) # aucun attribut (le text devient le libellé) - - def __init__(self, id, competence_id, libelle): - self.id = id - self.competence_id = competence_id - self.libelle = libelle - def to_dict(self): return {"libelle": self.libelle} @@ -306,11 +240,6 @@ class ApcComposanteEssentielle(db.Model, XMLModel): ) libelle = db.Column(db.Text(), nullable=False) - def __init__(self, id, competence_id, libelle): - self.id = id - self.competence_id = competence_id - self.libelle = libelle - def to_dict(self): return {"libelle": self.libelle} @@ -339,14 +268,6 @@ class ApcNiveau(db.Model, XMLModel): ) ues = db.relationship("UniteEns", back_populates="niveau_competence") - def __init__(self, id, competence_id, libelle, annee, ordre, app_critiques): - self.id = id - self.competence_id = competence_id - self.libelle = libelle - self.annee = annee - self.ordre = ordre - self.app_critiques = app_critiques - def __repr__(self): return f"""<{self.__class__.__name__} {self.id} ordre={self.ordre!r} annee={ self.annee!r} {self.competence!r}>""" @@ -452,13 +373,6 @@ class ApcAppCritique(db.Model, XMLModel): query = query.filter(ApcNiveau.competence == competence) return query - def __init__(self, id, niveau_id, code, libelle, modules): - self.id = id - self.niveau_id = niveau_id - self.code = code - self.libelle = libelle - self.modules = modules - def to_dict(self) -> dict: return {"libelle": self.libelle} @@ -517,14 +431,6 @@ class ApcParcours(db.Model, XMLModel): cascade="all, delete-orphan", ) - def __init__(self, id, referentiel_id, numero, code, libelle, annes): - self.id = id - self.referentiel_id = referentiel_id - self.numero = numero - self.code = code - self.libelle = libelle - self.annes = annes - def __repr__(self): return f"<{self.__class__.__name__} {self.id} {self.code!r} ref={self.referentiel}>" @@ -545,11 +451,6 @@ class ApcAnneeParcours(db.Model, XMLModel): ordre = db.Column(db.Integer) "numéro de l'année: 1, 2, 3" - def __init__(self, id, parcours_id, ordre): - self.id = id - self.parcours_id = parcours_id - self.ordre = ordre - def __repr__(self): return f"<{self.__class__.__name__} {self.id} ordre={self.ordre!r} parcours={self.parcours.code!r}>" diff --git a/app/models/formsemestre.py b/app/models/formsemestre.py index 68379e8b..4887c7b1 100644 --- a/app/models/formsemestre.py +++ b/app/models/formsemestre.py @@ -654,11 +654,6 @@ class FormSemestreEtape(db.Model): # etape_apo aurait du etre not null, mais oublié etape_apo = db.Column(db.String(APO_CODE_STR_LEN), index=True) - def __init__(self, id, formsemestre_id, etape_apo): - self.id = id - self.formsemestre_id = formsemestre_id - self.etape_apo = etape_apo - def __bool__(self): "Etape False if code empty" return self.etape_apo is not None and (len(self.etape_apo) > 0) diff --git a/app/models/notes.py b/app/models/notes.py index b3595126..a3e8dc0f 100644 --- a/app/models/notes.py +++ b/app/models/notes.py @@ -47,14 +47,6 @@ class NotesNotes(db.Model): date = db.Column(db.DateTime(timezone=True), server_default=db.func.now()) uid = db.Column(db.Integer, db.ForeignKey("user.id")) - def __init__(self, etudid, evaluation_id, value, comment, date, uid): - self.etudid = etudid - self.evaluation_id = evaluation_id - self.value = value - self.comment = comment - self.date = date - self.uid = uid - def to_dict(self): return { "id": self.id, diff --git a/app/scodoc/sco_apogee_csv.py b/app/scodoc/sco_apogee_csv.py index eef95a09..e6b40842 100644 --- a/app/scodoc/sco_apogee_csv.py +++ b/app/scodoc/sco_apogee_csv.py @@ -433,8 +433,6 @@ class ApoEtud(dict): return VOID_APO_RES # Elements UE - # if etudid == 3661 and nt.formsemestre.semestre_id == 2: # XXX XXX XXX - # breakpoint() decisions_ue = nt.get_etud_decision_ues(etudid) for ue in nt.get_ues_stat_dict(): if ue["code_apogee"] and code in {