Creating structure for the game events (#3)
* Adding the GameVent model and migration * Initializing the GameEvent endpoint * GameEvent listing endpoint * Adding CLICK_NAIVE event * Added signal for identify what is on the click location * Using row and col integer is better than metadata with jsonfield * Create event for the same position is not allowed * Better signals control * Adding a board progress to Game model * Identifying the win status * Hide generated board from client
This commit is contained in:
51
game/migrations/0005_auto_20201106_2357.py
Normal file
51
game/migrations/0005_auto_20201106_2357.py
Normal file
@@ -0,0 +1,51 @@
|
||||
# Generated by Django 3.1.3 on 2020-11-06 23:57
|
||||
|
||||
from django.db import migrations, models
|
||||
import game.models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("game", "0004_auto_20201106_0453"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RemoveField(model_name="gameevent", name="metadata",),
|
||||
migrations.AddField(
|
||||
model_name="gameevent",
|
||||
name="event_col",
|
||||
field=models.PositiveIntegerField(
|
||||
blank=True,
|
||||
default=None,
|
||||
help_text="Column on the board where the event occurred, if applicable",
|
||||
null=True,
|
||||
verbose_name="The column clicked",
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="gameevent",
|
||||
name="event_row",
|
||||
field=models.PositiveIntegerField(
|
||||
blank=True,
|
||||
default=None,
|
||||
help_text="Row on the board where the event occurred, if applicable",
|
||||
null=True,
|
||||
verbose_name="The row clicked",
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="game",
|
||||
name="status",
|
||||
field=models.IntegerField(
|
||||
choices=[
|
||||
(0, "NOT_PLAYED"),
|
||||
(1, "PLAYING"),
|
||||
(2, "PAUSED"),
|
||||
(3, "FINISHED"),
|
||||
],
|
||||
default=game.models.GameStatuses["NOT_PLAYED"],
|
||||
help_text="Actual game status",
|
||||
),
|
||||
),
|
||||
]
|
||||
Reference in New Issue
Block a user