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

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

项目:django-admin-rangefilter    作者:silentsokolov    | 项目源码 | 文件源码
def _get_form_fields(self):
        return OrderedDict((
                (self.lookup_kwarg_gte, forms.DateField(
                    label='',
                    widget=AdminDateWidget(attrs={'placeholder': _('From date')}),
                    localize=True,
                    required=False
                )),
                (self.lookup_kwarg_lte, forms.DateField(
                    label='',
                    widget=AdminDateWidget(attrs={'placeholder': _('To date')}),
                    localize=True,
                    required=False
                )),
        ))
项目: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',
            })