I'm attempting to write a browser game using Django but I'm getting a bit stuck on how to store the settings for the game. For example, the game is tick based and I want to store the current tick. I have decided that I want only one game per database to avoid problems with the built-in user authorisation system (e.g. I don't want to say username X is unavailable because it is already used in a different game). As far as I can tell, I still need to store this information in a database table, but I'm not sure how to best do that. I seem to have 2 options:
A) Have the game as a normal model referenced by other tables (e.g. my User profile), and just ignore the possibility that there can be more than 1 game. This would mean that it would be technically possible to have 2 game rows, but if there were things would break very easily.
B) I have a model that I always assume has one and only one row which stores all the configuration data for the game. This model only contains static methods and none of the other models have references to it. E.g.:
class Game(models.Model):
current_slot = models.PositiveIntegerField(default=0)
@staticmethod
def slots_per_day(self):
Genre.objects.get(id=1).current_slot
Neither of these options seem "right" to me but can anyone tell me if one is better than the other? Or if there is another option I haven't seen yet?