Home » Python » python – Simple app to matching persons to board game-Exceptionshub

python – Simple app to matching persons to board game-Exceptionshub

Posted by: admin February 24, 2020 Leave a comment

Questions:

I searched the internet similar apps or some useful staf but i cant found, so i

I have some python and django experience, i made blog site, and chatbot application.
Now i want to make simple application with using Python and Django to choose board game from my collection to play with friends.
In my app i want to have a person with preferences

(example: “person 1” like strategy and coop games, “person 2” like card strategy game).

Next

In my base i have game with attributes

(example: “Game 1” strategy, card, coop, “Game 2” is RPG game)

On my website i want to have list with name of my persons and checkboxes next to everyone. I can mark checkbox next to the person and send request to my base.
I want to get return with the best options to play based by personal preference and game attributes.

(Example: “person 1” like strategy and coop games, “person 2” like card strategy game so my base return “Game 1” strategy, card, coop, and second “Game 3” strategy and coop)

Question:

  1. How to do it, what I need to use, conditional statements, JS?
  2. I nees some exampels, similar app or useful documetation to read.

Thanks for any help.

My code:

models.py:

class Preferences(models.Model):
    pref = models.CharField(max_length=64)

class Person(models.Model):
    name = models.CharField(max_length=128)
    preferences = models.ManyToManyField(Preferences)

class Game(models.Model):
    name = models.CharField(max_length=128)
    preferences = models.ManyToManyField(Preferences)
How to&Answers: