'Perform an action on an object.'

def object_action(self, context, objinst, objmethod, args, kwargs):

    oldobj = objinst.obj_clone()
    result = self._object_dispatch(objinst, objmethod, args, kwargs)
    updates = dict()
    for (name, field) in objinst.fields.items():
        if (not objinst.obj_attr_is_set(name)):
            continue
        if ((not oldobj.obj_attr_is_set(name)) or (getattr(oldobj, name) != getattr(objinst, name))):
            updates[name] = field.to_primitive(objinst, name, getattr(objinst, name))
    updates['obj_what_changed'] = objinst.obj_what_changed()
    return (updates, result)
