mirror of
https://github.com/Findus23/RPGnotes.git
synced 2024-09-18 14:33:44 +02:00
20 lines
491 B
Python
20 lines
491 B
Python
from django.forms import ModelForm, ModelMultipleChoiceField, CheckboxSelectMultiple, DateInput
|
|
|
|
from days.models import Session, IngameDay
|
|
|
|
|
|
class DayForm(ModelForm):
|
|
sessions = ModelMultipleChoiceField(
|
|
queryset=Session.objects.all(),
|
|
widget=CheckboxSelectMultiple()
|
|
)
|
|
|
|
class Meta:
|
|
model = IngameDay
|
|
fields = ["day", "description_md", "sessions"]
|
|
|
|
|
|
class SessionForm(ModelForm):
|
|
class Meta:
|
|
model = Session
|
|
fields = ["date"]
|