

def get_field_type_from_document(instance, field_name):
    field_type = instance.structure[field_name]
    if isinstance(field_type, list):
        field_type = list
    if isinstance(field_type, dict):
        field_type = dict
    return field_type

dataset/ETHPy150Open peterbe/django-mongokit/django_mongokit/forms/forms.py get_field_type_from_document/original