Model with relations

System Information
  • Strapi Version: 3.4.1
  • Operating System: Mac OS Catalina 10.15.7
  • Database: SQLite
  • Node Version:
  • NPM Version:
  • Yarn Version:

I have three models:

  • games
  • players
  • plays

In games I have:

  • players (many-to-many)
  • plays (one-to-many)

In players I have:

  • games (many-to-many)
  • plays (many-to-many)

In plays I have:

  • game (many-to-one)
  • players (many-to-many)

I added a new play with game and players. So in games now I have plays: [{id: 1, ...}] but I don’t have any players. And in players I have plays: [{id: 1, ...}] but I don’t have any games.

What should I do to get players in game from plays and games in player from plays?

1 Like

I had a same problem, please help if possible

I was looking for a good casino. And what do you want to tell me that your online platform is a good site? No, definitely not, it’s not exactly what I was looking for. You have very high commissions, not everyone understands your menu. I can recommend another platform, which I liked much more than yours. I don’t think you have a better bonus program anywhere. A very wide variety of games, more than you, I am sure that everyone will find on this online platform, his favorite game, and it will start to make a lot of money.

Ensure the following relationships are correctly defined in the context of “fire kirin fish game”:

  • In the “fire kirin fish game” model: many-to-many with “players,” one-to-many with “plays.”
  • In the “players” model: many-to-many with “fire kirin fish game,” many-to-many with “plays.”
  • In the “plays” model: many-to-one with “fire kirin fish game,” many-to-many with “players.”

When adding a new play, associate players and the “fire kirin fish game” properly. To retrieve players in a “fire kirin fish game”: Plays.objects.filter(fire_kirin_fish_game_id=1).values('players'). To retrieve “fire kirin fish game” in a player: Plays.objects.filter(players=1).values('fire_kirin_fish_game'). Ensure data insertion aligns with these relationships.