Declaring relationships with the models
Make sure you quit the Django's development server. Remember that you just need to press
in the terminal or command-prompt window in which it is running. Now, we will create the models that we are going to use to represent and persist the game categories, games, players and scores, and their relationships. Open the
games/models.py file and replace its contents with the following code. The lines that declare fields related to other models are highlighted in the code listing. The code file for the sample is included in the
from django.db import models class GameCategory(models.Model): name = models.CharField(max_length=200) class Meta: ordering = ('name',) def ...