'Check the type of object passed to query relations.'

def check_related_objects(self, field, value, opts):

    if field.is_relation:
        if (isinstance(value, Query) and (not value.has_select_fields) and (not check_rel_lookup_compatibility(value.model, opts, field))):
            raise ValueError(('Cannot    use    QuerySet    for    "%s":    Use    a    QuerySet    for    "%s".' % (value.model._meta.object_name, opts.object_name)))
        elif hasattr(value, '_meta'):
            self.check_query_object_type(value, opts, field)
        elif hasattr(value, '__iter__'):
            for v in value:
                self.check_query_object_type(v, opts, field)
