'Validate that prepopulated_fields if a dictionary  containing allowed field types.'

def validate_prepopulated_fields(self, cls, model):

    if hasattr(cls, 'prepopulated_fields'):
        check_isdict(cls, 'prepopulated_fields', cls.prepopulated_fields)
        for (field, val) in cls.prepopulated_fields.items():
            f = get_field(cls, model, 'prepopulated_fields', field)
            if isinstance(f, (models.DateTimeField, models.ForeignKey, models.ManyToManyField)):
                raise ImproperlyConfigured(("'%s.prepopulated_fields['%s']'    is    either    a    DateTimeField,    ForeignKey    or    ManyToManyField.    This    isn't    allowed." % (cls.__name__, field)))
            check_isseq(cls, ("prepopulated_fields['%s']" % field), val)
            for (idx, f) in enumerate(val):
                get_field(cls, model, ("prepopulated_fields['%s'][%d]" % (field, idx)), f)
