@classmethod
    def widget_from_django_field(cls, f, default=widgets.Widget):
        result = default
        internal_type = f.get_internal_type()
        if internal_type in ('ManyToManyField', ):
            result = functools.partial(widgets.ManyToManyWidget,
                                       model=f.rel.to)
        if internal_type in ('ForeignKey', 'OneToOneField', ):
            result = functools.partial(widgets.ForeignKeyWidget,
                                       model=f.rel.to)
        if internal_type in ('DecimalField', ):
            result = widgets.DecimalWidget
        if internal_type in ('DateTimeField', ):
            result = widgets.DateTimeWidget
        elif internal_type in ('DateField', ):
            result = widgets.DateWidget
        elif internal_type in ('TimeField', ):
            result = widgets.TimeWidget
        elif internal_type in ('FloatField',):
            result = widgets.FloatWidget
        elif internal_type in ('IntegerField', 'PositiveIntegerField',
                               'BigIntegerField', 'PositiveSmallIntegerField',
                               'SmallIntegerField', 'AutoField'):
            result = widgets.IntegerWidget
        elif internal_type in ('BooleanField', 'NullBooleanField'):
            result = widgets.BooleanWidget
        return result
Optionally setup device specific timeout value logic.
dataset/ETHPy150Open django-import-export/django-import-export/import_export/resources.py/ModelResource.widget_from_django_field--crossover with--dataset/ETHPy150Open google/capirca/tools/ldpush/base_device.py/BaseDevice._SetupTimeouts