19 lines
741 B
Python
19 lines
741 B
Python
"""Tryout-specific team (e.g. Alpha, Bravo within a single tryout)."""
|
|
|
|
from app.extensions import db
|
|
from app.time_utils import utc_now_naive
|
|
|
|
|
|
class Team(db.Model):
|
|
"""Tryout-specific team (e.g. Alpha, Bravo within a single tryout)."""
|
|
|
|
__tablename__ = 'teams'
|
|
id = db.Column(db.Integer, primary_key=True)
|
|
tryout_id = db.Column(db.Integer, db.ForeignKey('tryouts.id'), nullable=False)
|
|
name = db.Column(db.String(100), nullable=False)
|
|
created_by = db.Column(db.Integer, db.ForeignKey('users.id'), nullable=False)
|
|
created_at = db.Column(db.DateTime, default=utc_now_naive)
|
|
|
|
creator = db.relationship('User', backref='created_teams')
|
|
members = db.relationship('TeamMember', backref='team', lazy='dynamic')
|