ft_transcendence/games/models.py

14 lines
346 B
Python
Raw Permalink Normal View History

2023-12-12 06:06:13 -05:00
from django.db import models
# Create your models here.
class GameModel(models.Model):
def create(self, users_id: [int]):
self.save()
for user_id in users_id:
GameMembersModel(game_id=self.pk, member_id=user_id)
return self.pk
class GameMembersModel(models.Model):
game_id = models.IntegerField()
member_id = models.IntegerField()