QUA-002, premiere moitie. **Ce commit ne fait que reformater** : aucun changement de comportement, aucune ligne de logique touchee. 72 fichiers, 4 restaient deja conformes. Il est isole exprès, pour que `git log -p` sur les commits voisins reste lisible. `quote-style = "preserve"` etait deja pose dans pyproject.toml, ce qui evite le brassage guillemets simples / doubles : le diff porte sur les retours a la ligne, l indentation des appels longs et les virgules finales, pas sur le style de chaine. Verification : 263 tests passent avant et apres, ruff check propre. L activation en CI arrive dans le commit suivant, separement, pour que ce diff-ci ne contienne rien d autre. Co-Authored-By: Claude Opus 5 <[email protected]>
25 lines
946 B
Python
25 lines
946 B
Python
"""Regular-season match for an organisation team (not tied to a tryout)."""
|
|
|
|
from app.extensions import db
|
|
from app.models.match_model.base import BaseMatch
|
|
|
|
|
|
class TeamMatch(BaseMatch):
|
|
"""Regular-season match for an organisation team (not tied to a tryout)."""
|
|
|
|
__tablename__ = 'team_matches'
|
|
id = db.Column(db.Integer, primary_key=True)
|
|
org_team_id = db.Column(db.Integer, db.ForeignKey('org_teams.id'), nullable=False)
|
|
opponent = db.Column(db.String(200), nullable=True)
|
|
|
|
org_team = db.relationship('OrgTeam', backref='team_matches')
|
|
creator = db.relationship('User', backref='created_team_matches')
|
|
participants = db.relationship(
|
|
'TeamMatchParticipant', backref='team_match', lazy='dynamic', cascade='all, delete-orphan'
|
|
)
|
|
|
|
def get_confirmed_count(self):
|
|
all_p = self.participants.all()
|
|
confirmed = sum(1 for p in all_p if p.is_confirmed)
|
|
return confirmed, len(all_p)
|