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

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

项目:django-hashid-field    作者:nshafer    | 项目源码 | 文件源码
def formfield(self, **kwargs):
        defaults = {'form_class': forms.CharField}
        defaults.update(kwargs)
        if defaults.get('widget') == admin_widgets.AdminIntegerFieldWidget:
            defaults['widget'] = admin_widgets.AdminTextInputWidget
        return super(HashidField, self).formfield(**defaults)