ScoDoc/app/models/events.py

37 lines
1.2 KiB
Python
Raw Permalink Normal View History

# -*- coding: UTF-8 -*
"""Evenements et logs divers
"""
from app import db
from app.models import SHORT_STR_LEN
class Scolog(db.Model):
"""Log des actions (journal modif etudiants)"""
__tablename__ = "scolog"
id = db.Column(db.Integer, primary_key=True)
date = db.Column(db.DateTime(timezone=True), server_default=db.func.now())
2021-08-10 12:57:38 +02:00
method = db.Column(db.Text)
msg = db.Column(db.Text)
etudid = db.Column(db.Integer) # sans contrainte pour garder logs après suppression
authenticated_user = db.Column(db.Text) # login, sans contrainte
# zope_remote_addr suppressed
class ScolarNews(db.Model):
"""Nouvelles pour page d'accueil"""
__tablename__ = "scolar_news"
id = db.Column(db.Integer, primary_key=True)
2021-08-13 11:26:22 +02:00
dept_id = db.Column(db.Integer, db.ForeignKey("departement.id"), index=True)
date = db.Column(db.DateTime(timezone=True), server_default=db.func.now())
authenticated_user = db.Column(db.Text) # login, sans contrainte
# type in 'INSCR', 'NOTES', 'FORM', 'SEM', 'MISC'
type = db.Column(db.String(SHORT_STR_LEN))
object = db.Column(db.Integer) # moduleimpl_id, formation_id, formsemestre_id
text = db.Column(db.Text)
url = db.Column(db.Text)