2021-08-07 15:20:30 +02:00
|
|
|
# -*- coding: UTF-8 -*
|
|
|
|
|
|
|
|
"""Model : preferences
|
|
|
|
"""
|
2022-01-21 00:46:45 +01:00
|
|
|
|
2024-07-19 09:42:44 +02:00
|
|
|
from app import db, models
|
2021-08-07 15:20:30 +02:00
|
|
|
|
|
|
|
|
2024-07-19 09:42:44 +02:00
|
|
|
class ScoPreference(models.ScoDocModel):
|
2021-09-05 12:30:11 +02:00
|
|
|
"""ScoDoc preferences (par département)"""
|
2021-08-07 15:20:30 +02:00
|
|
|
|
|
|
|
__tablename__ = "sco_prefs"
|
|
|
|
id = db.Column(db.Integer, primary_key=True)
|
|
|
|
pref_id = db.synonym("id")
|
2021-08-13 00:34:58 +02:00
|
|
|
|
|
|
|
dept_id = db.Column(db.Integer, db.ForeignKey("departement.id"))
|
|
|
|
|
|
|
|
name = db.Column(db.String(128), nullable=False, index=True)
|
2021-08-07 15:20:30 +02:00
|
|
|
value = db.Column(db.Text())
|
|
|
|
formsemestre_id = db.Column(db.Integer, db.ForeignKey("notes_formsemestre.id"))
|
2022-08-04 16:54:59 +02:00
|
|
|
|
2024-07-19 09:42:44 +02:00
|
|
|
_sco_dept_relations = ("FormSemestre",) # accès au dept_id
|
|
|
|
|
2022-08-04 16:54:59 +02:00
|
|
|
def __repr__(self):
|
2024-07-19 09:42:44 +02:00
|
|
|
return f"""<{self.__class__.__name__} {self.id} {self.departement.acronym
|
|
|
|
} {self.name}={self.value}>"""
|