ypdated the grpups page and upload

This commit is contained in:
2025-04-10 16:30:54 +03:00
parent e0b4e2b2d7
commit 4e3c8915d2
19 changed files with 279 additions and 45 deletions

View File

@@ -48,4 +48,15 @@ class User(db.Model, UserMixin):
def get_id(self):
return str(self.id)
class Group(db.Model):
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String(100), nullable=False, unique=True)
players = db.relationship('Player', secondary='group_player', backref='groups')
# Association table for many-to-many relationship between Group and Player
group_player = db.Table('group_player',
db.Column('group_id', db.Integer, db.ForeignKey('group.id'), primary_key=True),
db.Column('player_id', db.Integer, db.ForeignKey('player.id'), primary_key=True)
)
# other models...