Python django.contrib.admin.widgets 模块,AdminSplitDateTime() 实例源码

我们从Python开源项目中,提取了以下3个代码示例,用于说明如何使用django.contrib.admin.widgets.AdminSplitDateTime()

项目:Peru    作者:ESEGroup    | 项目源码 | 文件源码
def __init__(self, *args, **kwargs):
        super(formAnuncio, self).__init__(*args, **kwargs)
        self.fields['data_inicio'].widget = widgets.AdminSplitDateTime()
        self.fields['data_fim'].widget = widgets.AdminSplitDateTime()
        if kwargs.get('instance'):
            id = kwargs.get('instance').id
项目:Peru    作者:ESEGroup    | 项目源码 | 文件源码
def __init__(self, *args, **kwargs):
        super(formAnuncioEdit, self).__init__(*args, **kwargs)
        self.fields['data_inicio'].widget = widgets.AdminSplitDateTime()
        self.fields['data_fim'].widget = widgets.AdminSplitDateTime()
        if kwargs.get('instance'):
            id = kwargs.get('instance').id
项目:celery-monitor    作者:jimmy201602    | 项目源码 | 文件源码
def setUp(self):
            class TestForm(forms.Form):
                char = forms.CharField(max_length=255)
                hidden = forms.CharField(max_length=255, widget=forms.HiddenInput())
                date = forms.DateField(widget=AdminDateWidget())
                datetime = forms.DateTimeField(widget=AdminSplitDateTime())

            self.form = TestForm({
                'char': 'hi there',
                'hidden': 'hidden text',
                'date': '20140111',
            })