Fixed #14334 -- Query relation lookups now check object types.

I think the '__iter__' attribute works fine.
Why would that be required?