src/cm/utils/misc.py
author gibus
Thu, 28 Nov 2013 09:11:51 +0100
changeset 565 95a5c06c4008
parent 0 40c8f766c9b8
permissions -rw-r--r--
With JQuery > 1.6 replace .attr() by .prop() or .val(), see http://api.jquery.com/prop/


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)