def inline_for_model(model, variants=[], inline_args={}):
    """
    A shortcut function to produce ModelInlines for django models
    """

    if not isinstance(model, ModelBase):
        raise ValueError("inline_for_model requires it's argument to be a Django Model")
    d = dict(model=model)
    if variants:
        d['variants'] = variants
    if inline_args:
        d['args'] = inline_args
    class_name = "%sInline" % model._meta.module_name.capitalize()
    return type(class_name, (ModelInline,), d)
dataset/ETHPy150Open mintchaos/django_inlines/django_inlines/inlines.py/inline_for_model/original