コード例 #1
0
ファイル: widgets.py プロジェクト: hsyoon702/hongseok_jolup
 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)
コード例 #2
0
ファイル: widgets.py プロジェクト: gauravjana/Form
 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)
コード例 #3
0
    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
コード例 #4
0
    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
コード例 #5
0
 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)
コード例 #6
0
 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)
コード例 #7
0
 def __init__(self, attrs=None):
     widgets = (TextInput, TextInput)
     MultiWidget.__init__(self, widgets, attrs)
コード例 #8
0
ファイル: widgets.py プロジェクト: OpenTTD-Ladder/ladder-web
 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