timetracker/src/web/tracker/forms.py

33 lines
699 B
Python
Raw Normal View History

2022-12-31 13:18:27 +00:00
from django import forms
2023-01-04 16:23:34 +00:00
from .models import Session, Purchase, Game, Platform
2022-12-31 13:18:27 +00:00
class SessionForm(forms.ModelForm):
class Meta:
model = Session
fields = [
"purchase",
"timestamp_start",
"timestamp_end",
"duration_manual",
"note",
]
class PurchaseForm(forms.ModelForm):
class Meta:
model = Purchase
fields = ["game", "platform", "date_purchased", "date_refunded"]
class GameForm(forms.ModelForm):
class Meta:
model = Game
fields = ["name", "wikidata"]
2023-01-04 16:23:34 +00:00
class PlatformForm(forms.ModelForm):
class Meta:
model = Platform
fields = ["name", "group"]