Answer the question
In order to leave comments, you need to log in
How to organize such a system?
Good day, citizens
Give me a kick so that I understand which way to dig
Actually the question
There is a text rpg on django
There is a hero in the game he has items of equipment, indicators, etc.
I want to make an "arena" - the arena is available for a certain amount of time Let's say 2 hours. There the player fought with others for 2 hours and the arena was closed to everyone.
My thoughts, create a table with fields
1. arena_exp_time (end time)
2. arena_user_id (link to the user (OneToOne) who entered it)
3. user_win_count (number of wins in this arena in 2 hours)
But that's not the problem, say, if there are 5 such arenas per day? to create on 5 tables for everyone? No, I think it's complete nonsense.
What to read to implement this?
Thanks to
Answer the question
In order to leave comments, you need to log in
What's the problem with organizing something like this?
class Arena(models.Model):
exp_time = models.DateTimeField(...
win_count = models.PositiveIntegerField(default=0, ...
...
class ArenaUser(models.Model):
arena = models.ForeignKey(Arena,...
user = models.ForeignKey(User,...
...
class Arena(models.Model):
exp_time = models.DateTimeField(...
win_count = models.PositiveIntegerField(default=0, ...
users = models.ManyToManyField(User,...
...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question