guild-journal/guild/forms.py

15 lines
449 B
Python

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"}),
"characters": forms.CheckboxSelectMultiple(),
"summary": forms.Textarea(attrs={"rows": 32}),
}