def copy_model_instance(obj, exclude=None):
    """
    Copy a model instance, excluding primary key and optionally a list
    of specified fields.
    """

    exclude = exclude or ()
    initial = {
        f.name: getattr(obj, f.name)
        for f in obj._meta.fields
        if not isinstance(f, AutoField)
        and f.name not in exclude
        and f not in obj._meta.parents.values()
    }
    return obj.__class__(**initial)

    Copy a model instance, excluding primary key and optionally a list
    of specified fields.
    
feincms/utils/__init__.py