* 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
16 lines
325 B
Python
16 lines
325 B
Python
from rest_framework import serializers
|
|
|
|
from game.models import Game, GameEvent
|
|
|
|
|
|
class GameSerializer(serializers.ModelSerializer):
|
|
class Meta:
|
|
model = Game
|
|
exclude = ["board"]
|
|
|
|
|
|
class GameEventSerializer(serializers.ModelSerializer):
|
|
class Meta:
|
|
model = GameEvent
|
|
fields = "__all__"
|