Make it possible to edit and delete status changes
All checks were successful
Django CI/CD / test (push) Successful in 1m11s
Django CI/CD / build-and-push (push) Successful in 2m18s

This commit is contained in:
2025-03-22 23:45:02 +01:00
parent 89de85c00d
commit 23b4a7a069
7 changed files with 137 additions and 6 deletions

View File

@ -2,7 +2,15 @@ from django import forms
from django.urls import reverse
from common.utils import safe_getattr
from games.models import Device, Game, Platform, PlayEvent, Purchase, Session
from games.models import (
Device,
Game,
GameStatusChange,
Platform,
PlayEvent,
Purchase,
Session,
)
custom_date_widget = forms.DateInput(attrs={"type": "date"})
custom_datetime_widget = forms.DateTimeInput(
@ -212,3 +220,17 @@ class PlayEventForm(forms.ModelForm):
"started": custom_date_widget,
"ended": custom_date_widget,
}
class GameStatusChangeForm(forms.ModelForm):
class Meta:
model = GameStatusChange
fields = [
"game",
"old_status",
"new_status",
"timestamp",
]
widgets = {
"timestamp": custom_datetime_widget,
}