src/cm/utils/misc.py
author Production Moz <dev@sopinspace.com>
Wed, 04 Sep 2013 22:11:01 +0200
changeset 529 5eeed336b992
parent 0 40c8f766c9b8
permissions -rw-r--r--
Filter by category should also be tested for undefined (and not just empty string) in case no category has been defined.


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)