def __init__(self, attrs=None, date_format=None, time_format=None): date_input = DateInput(attrs=attrs, format=date_format) date_input.input_type = 'date' time_input = TimeInput(attrs=attrs, format=time_format) time_input.input_type = 'time' widgets = (date_input, time_input) MultiWidget.__init__(self, widgets, attrs)
def value_from_datadict(self, data, files, name): """ account for the fact that the timezone widget always returns a value (the default) even without interaction, and with a blank date and time, it doesn't make sense """ value_list = MultiWidget.value_from_datadict(self, data, files, name) DATE_INDEX = 0 TIME_INDEX = 1 TZ_INDEX = 2 if not value_list[DATE_INDEX] and not value_list[TIME_INDEX]: value_list[TZ_INDEX] = u'' return value_list
def __init__(self, attrs=None): widgets = [AdminTimeWidget, TimeZoneSelect] # Note that we're calling MultiWidget, not SplitTimeTimeZoneWidget, # because we want to define widgets. MultiWidget.__init__(self, widgets, attrs)
def __init__(self, attrs=None): widgets = (TextInput, TextInput) MultiWidget.__init__(self, widgets, attrs)
def __init__(self, attrs=None): # pylint: disable=W0231 widgets = [_DateInput, _TimeInput] # Note that we're calling MultiWidget, not SplitDateTimeWidget, because # we want to define widgets. MultiWidget.__init__(self, widgets, attrs) # pylint: disable=W0233