python - How to verify the input of type="datetime-local" through django form.is_valid()
仅有的幸福
仅有的幸福 2017-05-27 17:39:52
0
3
834

forms.py:

select_time = forms.DateTimeField(
    label='时间',
    input_formats=['%m/%d/%YT%H:%M'], 
    widget=forms.DateTimeInput(attrs={
        'class': 'weui-input', 
        'type': 'datetime-local', 
        'emptyTips': '请选择时间'
    })
)

In the above form, the time format passed is 2017-05-25T23:10, which cannot pass the form.is_valid() verification. How to deal with it?

仅有的幸福
仅有的幸福

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!