'Returns the widget that would likely be associated with each
Django type.'

@classmethod
def widget_from_django_field(cls, f, default=widgets.Widget):

    result = default
    internal_type = (f.get_internal_type() if callable(getattr(f, u'get_internal_type', None)) else u'')
    if (internal_type in (u'ManyToManyField',)):
        result = functools.partial(widgets.ManyToManyWidget, model=f.rel.to)
    if (internal_type in (u'ForeignKey', u'OneToOneField')):
        result = functools.partial(widgets.ForeignKeyWidget, model=f.rel.to)
    if (internal_type in (u'DecimalField',)):
        result = widgets.DecimalWidget
    if (internal_type in (u'DateTimeField',)):
        result = widgets.DateTimeWidget
    elif (internal_type in (u'DateField',)):
        result = widgets.DateWidget
    elif (internal_type in (u'TimeField',)):
        result = widgets.TimeWidget
    elif (internal_type in (u'DurationField',)):
        result = widgets.DurationWidget
    elif (internal_type in (u'FloatField',)):
        result = widgets.FloatWidget
    elif (internal_type in (u'IntegerField', u'PositiveIntegerField', u'BigIntegerField', u'PositiveSmallIntegerField', u'SmallIntegerField', u'AutoField')):
        result = widgets.IntegerWidget
    elif (internal_type in (u'BooleanField', u'NullBooleanField')):
        result = widgets.BooleanWidget
    elif (VERSION >= (1, 8)):
        try:
            from django.contrib.postgres.fields import ArrayField
        except ImportError:
            class ArrayField(object, ):
                pass
        if (type(f) == ArrayField):
            return widgets.SimpleArrayWidget
    return result
