Python django.contrib.admin.widgets.AdminIntegerFieldWidget() Examples

The following are 2 code examples of django.contrib.admin.widgets.AdminIntegerFieldWidget(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module django.contrib.admin.widgets , or try the search function .
Example #1
Source File: field.py    From django-hashid-field with MIT License 5 votes vote down vote up
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().formfield(**defaults) 
Example #2
Source File: tests.py    From djongo with GNU Affero General Public License v3.0 5 votes vote down vote up
def test_IntegerField(self):
        self.assertFormfield(Event, 'min_age', widgets.AdminIntegerFieldWidget)