forms
— Swingtime Forms
Convenience forms for adding and updating Event
and Occurrence
objects.
Functions
timeslot_options
- forms.timeslot_options([interval=swingtime_settings.TIMESLOT_INTERVAL, start_time=swingtime_settings.TIMESLOT_START_TIME, end_delta=swingtime_settings.TIMESLOT_END_TIME_DURATION, fmt=swingtime_settings.TIMESLOT_TIME_FORMAT])
Create a list of time slot options for use in swingtime forms.
The list is comprised of 2-tuples containing a 24-hour time value and a 12-hour temporal representation of that offset.
timeslot_offset_options
- forms.timeslot_offset_options([interval=swingtime_settings.TIMESLOT_INTERVAL, start_time=swingtime_settings.TIMESLOT_START_TIME, end_delta=swingtime_settings.TIMESLOT_END_TIME_DURATION, fmt=swingtime_settings.TIMESLOT_TIME_FORMAT])
Create a list of time slot options for use in swingtime forms.
The list is comprised of 2-tuples containing the number of seconds since the start of the day and a 12-hour temporal representation of that offset.
Data
default_timeslot_options
- forms.default_timeslot_options
defaults to
timeslot_options()
default_timeslot_offset_options
- forms.default_timeslot_offset_options
defaults to
timeslot_offset_options()
Classes
MultipleIntegerField
- class forms.MultipleIntegerField(django.forms.MultipleChoiceField)
A form field for handling multiple integers.
- def __init__(self, choices, size=None, label=None, widget=None):
- if widget is None:
widget = forms.SelectMultiple(attrs={‘size’ : size or len(choices)})
SplitDateTimeWidget
MultipleOccurrenceForm
- class forms.MultipleOccurrenceForm(django.forms.Form)
- day
forms.DateField
- start_time_delta
forms.IntegerField
- end_time_delta
forms.IntegerField
- repeats
forms.ChoiceField
- count
forms.IntegerField
- until
forms.DateField
- freq
forms.IntegerField
- interval
forms.IntegerField
- week_days
MultipleIntegerField
- month_ordinal
forms.IntegerField
- month_ordinal_day
forms.IntegerField
- each_month_day = MultipleIntegerField(
- year_months
MultipleIntegerField
- is_year_month_ordinal
forms.BooleanField(required=False)
- year_month_ordinal
forms.IntegerField(widget=forms.Select(choices=ORDINAL))
- year_month_ordinal_day
forms.IntegerField(widget=forms.Select(choices=WEEKDAY_LONG))
- __init__([*args, **kws])
if
initial
containsdtstart
- adatetime.datetime
instance - the appropriate unspecifiedinitial
will be defaulted for the form.
- clean()
populates
cleaned_data
withstart_time
andend_time
values
- save(event):
Returns an
Event
object
EventForm
- class forms.EventForm(django.forms.ModelForm)
A simple form for adding and updating Event attributes
SingleOccurrenceForm
- class forms.SingleOccurrenceForm(django.forms.ModelForm)
A simple form for adding and updating single Occurrence attributes