progression 50% pour evolution des joueurs
CI - Security, Lint & Tests / validate (push) Failing after 1m13s
CI - Security, Lint & Tests / validate (push) Failing after 1m13s
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
"""Coach comments on a specific objective."""
|
||||
|
||||
from app.extensions import db
|
||||
from app.time_utils import utc_now_naive
|
||||
|
||||
|
||||
class ObjectiveComment(db.Model):
|
||||
"""A coach's comment on a player-evolution objective.
|
||||
|
||||
This is a separate table from PersonalNote — no existing schema
|
||||
is altered. The objective-form page also *reads* PersonalNote and
|
||||
TeamNote for context, but never writes to those tables.
|
||||
"""
|
||||
|
||||
__tablename__ = 'objective_comments'
|
||||
|
||||
id = db.Column(db.Integer, primary_key=True)
|
||||
objective_id = db.Column(
|
||||
db.Integer,
|
||||
db.ForeignKey('objectives.id'),
|
||||
nullable=False,
|
||||
)
|
||||
coach_id = db.Column(db.Integer, db.ForeignKey('users.id'), nullable=False)
|
||||
content = db.Column(db.Text, nullable=False)
|
||||
created_at = db.Column(db.DateTime, default=utc_now_naive)
|
||||
updated_at = db.Column(db.DateTime, default=utc_now_naive, onupdate=utc_now_naive)
|
||||
|
||||
# -----------------------------------------------------------------------
|
||||
# Relationships
|
||||
# -----------------------------------------------------------------------
|
||||
objective = db.relationship(
|
||||
'Objective',
|
||||
backref=db.backref('comments', lazy='dynamic', order_by='ObjectiveComment.created_at'),
|
||||
)
|
||||
coach = db.relationship('User', foreign_keys=[coach_id])
|
||||
Reference in New Issue
Block a user