adds simple rel_where method to queryproxy

Very simple. Uses the most recently set rel identifier (either manual or automatic) and builds `where` around it.