src/cm/utils/misc.py
author gibus
Mon, 08 Nov 2010 12:41:44 +0100
changeset 329 00df963f91fb
parent 0 40c8f766c9b8
permissions -rw-r--r--
When comment_id_key is passed as URL parameter, focus on this comment, instead of the top comment of the related thread.


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)