guild-journal/guild/forms.py

14 lines
390 B
Python
Raw Normal View History

2023-06-10 20:32:45 +00:00
from django import forms
from guild.models import PlaySession
class PlaySessionForm(forms.ModelForm):
class Meta:
model = PlaySession
fields = ["date", "characters", "summary"]
# set date wideget to type="date"
widgets = {
"date": forms.DateInput(attrs={"type": "date"}),
2023-06-13 19:35:21 +00:00
"characters": forms.CheckboxSelectMultiple(),
2023-06-10 20:32:45 +00:00
}