* 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
30 lines
525 B
Python
30 lines
525 B
Python
from django.contrib import admin
|
|
|
|
from .models import Game, GameEvent
|
|
|
|
|
|
@admin.register(Game)
|
|
class GameAdmin(admin.ModelAdmin):
|
|
list_display = (
|
|
"id",
|
|
"created_at",
|
|
"modified_at",
|
|
"rows",
|
|
"cols",
|
|
"mines",
|
|
"win",
|
|
"status",
|
|
)
|
|
|
|
list_filter = (
|
|
"win",
|
|
"status",
|
|
)
|
|
|
|
|
|
@admin.register(GameEvent)
|
|
class GameEventAdmin(admin.ModelAdmin):
|
|
list_display = ("id", "created_at", "game", "type", "row", "col")
|
|
|
|
list_filter = ("type",)
|