我们从Python开源项目中,提取了以下47个代码示例,用于说明如何使用django.forms.SplitDateTimeWidget()。
def __init__(self, attrs=None): widgets = [AdminDateWidget, AdminTimeWidget] # Note that we're calling MultiWidget, not SplitDateTimeWidget, because # we want to define widgets. forms.MultiWidget.__init__(self, widgets, attrs)
def __init__(self, *args, **kwargs): kwargs.setdefault('input_formats', DATE_TIME_INPUT_FORMATS) kwargs.setdefault('widget', forms.SplitDateTimeWidget(date_format=DATE_INPUT_FORMATS[0])) kwargs.setdefault('error_messages', {'invalid': _('Please enter a date in dd.mm.yyyy format and time in format HH:MM.')}) super().__init__(*args, **kwargs)
def __init__(self, attrs=None): widgets = [DateWidget, TimeWidget] # Note that we're calling MultiWidget, not SplitDateTimeWidget, because # we want to define widgets. forms.MultiWidget.__init__(self, widgets, attrs)