src/cm/utils/misc.py
author gibus
Thu, 03 Oct 2013 10:46:05 +0200
changeset 544 18ac07f35974
parent 0 40c8f766c9b8
permissions -rw-r--r--
Get rid of 'allow_contact' field for UserProfile since it is unused.


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)