src/cm/utils/misc.py
author raph
Wed, 27 Jan 2010 16:18:30 +0100
changeset 130 f257ad33bed5
parent 0 40c8f766c9b8
permissions -rw-r--r--
model change+migration (add id_key to comment): run ./bin/django migrate


def update(obj, kwargs):
    """
    Update obj attributes with values from kwargs
    """
    for k,v in kwargs.items():
        if hasattr(obj,k):
            setattr(obj,k,v)