def clone ( src , * * kwargs ) : obj = object . __new__ ( type ( src ) ) obj . __dict__ . update ( src . __dict__ ) obj . __dict__ . update ( kwargs ) return obj
django python clone object
Clones object with optionally overridden fields
def clone(src, **kwargs):
    """Clones object with optionally overridden fields"""
    obj = object.__new__(type(src))
    obj.__dict__.update(src.__dict__)
    obj.__dict__.update(kwargs)
    return obj