def get_form_instance(**kwargs):
    """Returns form instance"""
    fields = []
    field_config = discover()[get_app_name(
        **kwargs)][get_model_name(**kwargs)]
    callee = type(inspect.currentframe().f_back.f_locals['self']).__name__
    operation = 'create' if 'Create' in callee else 'update'

    for field in field_config:
        if operation in field_config[field]:
            fields.append(field)

    return modelform_factory(get_model(**kwargs), fields=fields)
dataset/ETHPy150Open faxad/djangoCRUD/djangocrud/core/helpers.py/get_form_instance/original