What do you think about renaming the third arg, "query", to "param" or "param_name"? I think that would make it more self-documenting.

Also. this method needs a docstring. :)