Here are the examples of the python api django.forms.TimeInput taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
2 Examples
3
View Complete Implementation : test_timeinput.py
Copyright GNU Affero General Public License v3.0
Author : nesdis
Copyright GNU Affero General Public License v3.0
Author : nesdis
def test_format(self):
"""
Use 'format' to change the way a value is displayed.
"""
t = time(12, 51, 34, 482548)
widget = TimeInput(format='%H:%M', attrs={'type': 'time'})
self.check_html(widget, 'time', t, html='<input type="time" name="time" value="12:51">')
3
View Complete Implementation : forms.py
Copyright GNU General Public License v3.0
Author : Uninett
Copyright GNU General Public License v3.0
Author : Uninett
def __init__(self, *args, **kwargs):
super(AlertProfileForm, self).__init__(*args, **kwargs)
self.fields['daily_dispatch_time'].widget = forms.TimeInput(
format='%H:%M')
self.fields['weekly_dispatch_time'].widget = forms.TimeInput(
format='%H:%M')
self.helper = FormHelper()
self.helper.form_tag = False
self.helper.layout = Layout(
'id', 'name',
Row(
Column('daily_dispatch_time', css_clast='medium-4'),
Column('weekly_dispatch_time', css_clast='medium-4'),
Column(Field('weekly_dispatch_day', css_clast='select2'),
css_clast='medium-4')
)
)