citavi_mapper/frontend/formsets.py

27 lines
830 B
Python
Raw Normal View History

2014-12-10 16:28:21 +01:00
from django import forms
from frontend.models import Presentation, PresentationEvent, PresentationPerson
from django.forms.models import inlineformset_factory
2014-12-11 16:30:54 +01:00
from bootstrap3_datetime.widgets import DateTimePicker
2014-12-10 16:28:21 +01:00
PresentationPersonInlineFormset = inlineformset_factory(
Presentation,
PresentationPerson,
extra=1,
2014-12-10 16:28:21 +01:00
can_delete=False,
widgets={'hshmembership': forms.RadioSelect}
)
PresentationEventInlineFormset = inlineformset_factory(
Presentation,
PresentationEvent,
extra=1,
2014-12-11 16:30:54 +01:00
can_delete=False,
widgets={
'date': DateTimePicker(options={"format": "YYYY-MM-DD", 'pickSeconds': False}),
'start_date': DateTimePicker(options={"format": "YYYY-MM-DD", 'pickSeconds': False}),
'end_date': DateTimePicker(options={"format": "YYYY-MM-DD", 'pickSeconds': False})
}
)