|
@@ -13,7 +13,7 @@ class Game(db.Model):
|
|
|
timer = db.Column(db.Integer)
|
|
|
rounds = db.Column(db.Integer)
|
|
|
coordinates = db.relationship("Coordinate", lazy=True, order_by="Coordinate.round_number")
|
|
|
- players = db.relationship("Player", lazy=True)
|
|
|
+ players = db.relationship("Player", lazy=True, backref="game")
|
|
|
|
|
|
@staticmethod
|
|
|
def create(timer, rounds):
|
|
@@ -81,7 +81,7 @@ class Player(db.Model):
|
|
|
if len(self.guesses) == 0:
|
|
|
return 1
|
|
|
next_round = self.guesses[-1].round_number + 1
|
|
|
- if next_round <= Game.query.get(self.game_id).rounds:
|
|
|
+ if next_round <= self.game.rounds:
|
|
|
return next_round
|
|
|
return None
|
|
|
|